Skip to content

Instantly share code, notes, and snippets.

@owensd
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save owensd/50ced78edec7f8aa2b19 to your computer and use it in GitHub Desktop.

Select an option

Save owensd/50ced78edec7f8aa2b19 to your computer and use it in GitHub Desktop.
if ([json isKindOfClass:[NSDictionary class]]) {
NSDictionary *dict = json[@"blogs"];
if ([dict isKindOfClass:[NSDictionary class]]) {
NSArray *blogs = dict[@"blogs"][@"blog"];
if ([blogs isKindOfClass:[NSArray class]]) {
for (NSDictionary *blog in blogs) {
if ([blog isKindOfClass:[NSDictionary class]]) {
NSLog(@"Blog ID: %@", blog[@"id"]);
NSLog(@"Blog Name: %@", blog[@"name"]);
NSLog(@"Blog Needs Password: %@", blog[@"needspassword"]);
NSLog(@"Blog URL: %@", blog[@"url"]);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment