Last active
August 29, 2015 14:06
-
-
Save sstadelman/c4cf362f0d63710fc14a to your computer and use it in GitHub Desktop.
Tracking unique id's
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
| @interface MyViewController () | |
| @property (nonatomic, strong) NSString *accountRequestId; | |
| @property (nonatomic, strong) NSString *opportunityRequestId; | |
| //or | |
| @property (nonatomic, strong) NSMutableArray *accountRequests; | |
| @end | |
| @implementation MyViewController | |
| - (void) loadModel | |
| { | |
| id<SODataRequestExecution> requestExecution = [myStore scheduleReadEntitySet:@"Accounts" delegate:self options:nil]; | |
| self.accountRequestId = requestExecution.uniqueId; | |
| //or | |
| [self.accountRequests addObject:requestExecution.uniqueId]; | |
| } | |
| - (void) requestServerResponse:(id<SODataRequestExecution>)requestExecution | |
| { | |
| if ([requestExecution.uniqueId isEqualToString:self.accountRequestId]) { | |
| // update the Accounts model | |
| } else {} | |
| // or | |
| if ([self.accountRequests containsObject:requestExecution.uniqueId]) { | |
| // update the Accounts model | |
| [self.accountRequests removeObject:requestExecution.uniqueId]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment