Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS: Grand Central Dispatch and ViewControllers
    primarykey
    data
    text
    <p>At this point I'm pretty frustrated but I'm sure it is something I'm missing. In this code my segue to my new viewController is showing up after the rest of the function is executed. How do I get my viewController to be the code being executed? Basically stop the tweetText function from happening until that view is closed I'm trying to give the user an option to select a twitter account if there is more than one. I have tried many different ways. In Apples own example code they suggest to give the user an option but give nothing on how to do it without blowing through the rest of the code.</p> <p>Here is the code:</p> <pre><code> [accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) { if(granted) { dispatch_sync(dispatch_get_main_queue(), ^{ // Get the list of Twitter accounts. self.accountsArray = [accountStore accountsWithAccountType:accountType]; if([self.accountsArray count] &gt; 1 /* Check method to see if preference is still a valid account */) { // Display user accounts if no preference has been set [self performSegueWithIdentifier:@"TwitterAccounts" sender:self.accountsArray]; [tweet tweetText:tweetString account:self.twitterAccount type:AchievementTweet]; } else { [tweet tweetText:tweetString account:[self.accountsArray lastObject] type:AchievementTweet]; } }); } else { [tweet performSelectorOnMainThread:@selector(displayText:) withObject:[NSNumber numberWithInt:403] waitUntilDone:NO]; } }]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload