Created
March 1, 2012 13:06
-
-
Save bonkowski/1949711 to your computer and use it in GitHub Desktop.
Callback handler
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
- (void)jsonCallback:(int)aCompositeId json:(const char *)json { | |
NSString *jsonNSString = [NSString stringWithUTF8String:json]; | |
NSDictionary *root = [jsonNSString objectFromJSONString]; | |
if (root) { | |
NSString *action = [root objectForKey:@"action"]; | |
NSDictionary *options = [root objectForKey:@"options"]; | |
if ([action isEqualToString:POI_CLICKED]) { | |
[self handlePoiClicked:options]; | |
} else if ([action isEqualToString:CAMERA_POSITION_CHANGE]) { | |
[self handleCameraPositionChange:options]; | |
} else { | |
NSLog(@"jsonCallBack not handled: %@", jsonNSString); | |
} | |
} else { | |
NSLog(@"jsonCallBack: Error parsing jsonString '%@'", jsonNSString); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment