Created
May 4, 2012 18:36
-
-
Save EchoAbstract/2596810 to your computer and use it in GitHub Desktop.
Kinvey Delegate Methods
This file contains 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
#pragma mark - | |
#pragma mark KCSPersistableDelegate | |
// Kinvey: Called when a save is complete | |
-(void)entity:(id)entity operationDidCompleteWithResult:(NSObject *)result | |
{ | |
// Everything worked, so stop animating the activity indicator | |
[self.activityIndicator stopAnimating]; | |
} | |
// Kinvey: Called when a save Fails | |
- (void)entity:(id)entity operationDidFailWithError:(NSError *)error | |
{ | |
// Let the user know something went wrong and stop updating | |
[self.activityIndicator stopAnimating]; | |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Unable to Save Note" | |
message:error.localizedDescription | |
delegate:self cancelButtonTitle:@"Ok" | |
otherButtonTitles:nil]; | |
[alert show]; | |
} | |
#pragma mark - | |
#pragma mark KCSCollectionDelegate | |
// Kinvey: Called when our query finishes | |
- (void)collection:(KCSCollection *)collection didCompleteWithResult:(NSArray *)result | |
{ | |
// Add all the returned annotations to the map | |
[self.worldView addAnnotations:result]; | |
} | |
// Kinvey: Called when our query fails | |
- (void)collection:(KCSCollection *)collection didFailWithError:(NSError *)error | |
{ | |
// Let the user know something went wrong and stop updating | |
[self.activityIndicator stopAnimating]; | |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Unable to Get Notes" | |
message:error.localizedDescription | |
delegate:self cancelButtonTitle:@"Ok" | |
otherButtonTitles:nil]; | |
[alert show]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment