Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save sstadelman/650f41e21d8cc38a7b8a to your computer and use it in GitHub Desktop.

Select an option

Save sstadelman/650f41e21d8cc38a7b8a to your computer and use it in GitHub Desktop.
NSNotification subscribe for request notification
- (void) loadModel
{
NSString *accountRequestNotificationIdentifier = @"AccountRequest";
[[NSNotificationCenter defaultCenter] addObserverForName:accountRequestNotificationIdentifier object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
//update the Accounts model
}];
id<SODataRequestExecution> requestExecution = [myStore scheduleReadEntitySet:@"Accounts" delegate:self options:nil];
requestExecution.request.customTag = accountRequestNotificationIdentifier;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment