Easy iPhone and iPad Library For Communicating With Web Services – Open Source
Communicating with web services in your iPhone and iPad apps can be somewhat of a pain, and that’s why several open source libraries have been created to allow you to do just that.
While some of those libraries are good, I love it when someone comes up with something even easier. I found out on Twitter the other day about a great new open source library called Seriously which appears to be a very promising library for easy communication with web services and JSON parsing (XML parsing coming soon).
Just take a look at this code to grab the background image url from a twitter account:
NSString *url = @"http://api.twitter.com/1/users/show.json?screen_name=probablycorey";
[Seriously get:url handler:^(id body, NSHTTPURLResposne *response, NSError *error) {
if (error) {
NSLog(@"Got error %@", error);
}
else {
NSLog(@"Look, JSON gets parsed into an dictionary");
NSLog(@"%@", [body objectForKey:@"profile_background_image_url"]);
}
}];
Looks pretty good to me, short and sweet.
You can download Seriously on Github here:
http://github.com/probablycorey/seriously
If you liked this, please share it!
Would you like to learn iPhone and iPad programming online from professional instructors who have worked for companies such as EA and Disney Mobile?
Related Posts
Tags: ipad, iPhone, json, open source, REST