objective c - How to conditionally fire segue based on block-based network operation in iOS? -


i have block-based network function want allow segue commence when successful. attempt @ authentication:

[user signupinbackgroundwithblock:^(bool succeeded, nserror *error) {     nslog(@"in process");          if (!error) {             nslog(@"succcess");          }else{             nslog(@"failure");          }     }]; 

how can commence segue conditionally statement in viewcontroller?

[self performseguewithidentifier@"yoursegueidentifierthatyousetinstoryboard"]; should trick if understand question correctly.

edit 1:

to fire code on main thread, wrap code that:

dispatch_async(dispatch_get_main_queue(), ^{      [self performseguewithidentifier@"yoursegueidentifierthatyousetinstoryboard"];  }); 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -