Are events dispatched by NSNotificationCenter postNotificationName handled before updating the user interface?
I need to know, because otherwise my current program will crash in some rare cases.
Model Code:
- (void)searchFinishedWithResults:(Results *)results {
self.results = results;
[[NSNotificationCenter defaultCenter]
postNotificationName:SearchResultArrived object:nil];
}
When processing notifications, I ran reloadData UITableView.
However, consider whether to update the user interface before processing the notification. In this case, -tableView: cellForRowAtIndexPath: indexPath will be called, but the result object has changed, it will retrieve old data.
source
share