ios - How to wait for a Parse deleteAllInBackground call to finish? -


I am creating a simple message application using the pars structure I have displaymessages Is a method called it every time the phone receives a push.

However, as this message is working in a parsing database, I do not want to call it again if it is already running. I want to wait until it ends and then I am calling it.

I am using the following code:

  - Receive (zero) loop {[auto display message]; }  

and:

  - (zero) display message {// code here}  

if received Gone Push is said to be before I call it displaymessages before I want to wait. displaymessages I have a parsed call:

  [PFObject deleteAllInBackground: toDelete block: ^ (BOOL succeeded, NSError * error) {}];  

It really is that I need to wait, remove AllAllBackground how can I come to it? I tried to use the NSOperation queue and it is okay for the queue for the display, but it will not give my desired result to the app because because the display ends execution at some point, it is still deleteAllInBackground running

If I understand correctly, then your requirement is that you only display one "example" The messages you are running are running on a pahl. What you are asking to do is display the message "ThreadSoff" what you should do in the code wrap in the displayMessages @synchronized tag. Alternatively, you can make some kind of amount separation system that uses the flag, so the received PIN will actually add a push to a line and there will be a type of timer loop -bar displays the message, but only then does the fire when it is processing.

Create a manual "operation queue" in response to the comment, which you want to do it yourself

  - (zero) method ratioswithfirebitimar {if (self.flag) , {[Self display message]; }} - (zero) display message {pushdata * data = [auto decadenta]; // Maybe, not sure how you are accessing push data self.flag = NO; // code here [PFObject deleteAllInBackground: toDelete block: ^ (BOOL succeeded, NSError * error) {// Code here ... self.flag = YES; }]; } - Push received (zero): (pushdown data) {[self-encrypted data: data]; }  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -