in my app, i need to call a web service to get data (http get). I am a new ios dev, i wonder if i should dispatch the http get call to background, and bring tableview reload data to foreground like the code below? thanks bunch!
-(void)updateDataInBackground {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND,0), ^(void) {
// hard work/updating here
// when finished ...
[self reloadTable];
});
}
-(void)reloadTable {
dispatch_async(dispatch_get_main_queue(), ^(void) {
[myTableView reloadData];
});
}