Created
March 27, 2014 23:11
-
-
Save dokun1/9821212 to your computer and use it in GitHub Desktop.
A simple example of calling one of my custom connection manager methods with a success and failure block, a-la AFNetworking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
[[EDAConnectionManager sharedManager] getQuestionsWithSuccess:^(NSArray *questions) { | |
self.questions = questions; | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
[self.refreshControl endRefreshing]; | |
[self.tableView reloadData]; | |
}); | |
}failure:^(NSError *error) { | |
NSLog(@"error: %@", [error localizedDescription]); | |
}]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment