9

I'm having lots of trouble setting up the RestKit API to my app. I wonder if there is any other good API to make RESTful apps? I've just followed lots of tutorials and the github directory of the RestKit API, but I just can't get it up and running. I've seen that Xcode 4 is having problems importing this API.


This is an old question, Nowadays, after 4 years in iOS development I use AFNetworking: https://github.com/AFNetworking/AFNetworking

It is quite simple to start, and can be installed using cocoapods.

Cœur
  • 37,241
  • 25
  • 195
  • 267
JRafaelM
  • 861
  • 2
  • 10
  • 23
  • Would you care to specify what particular errors RestKit integration is spewing? Most of them can be easily solved. – bogo Aug 18 '11 at 18:43
  • Hi. I'm one of the core developers for RestKit. Please describe what your exact problem with RestKit is - here or in the mailing list - and we'll try to help you. – Victor K. Aug 18 '11 at 20:34
  • Victor, I followed every instruction at the github, and when i tried to #import it says there is no such file, same as with the other lib Peter suggested... But Ill try again today, Ive stayed 5,5h trying to solve these problems, I thought iOS dev wasn't so painful... – JRafaelM Aug 19 '11 at 11:20
  • when I imported "RestKit.h" it found something, but gave me build errors inside the framework btw... – JRafaelM Aug 19 '11 at 11:29

3 Answers3

6

I use ASIHTTPRequest for RESTful client stuff in my apps.

Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
  • ca u use JSON parses with it ? – JRafaelM Aug 18 '11 at 15:19
  • I tried to set up this, but it occurred many build failures, I'm googling it, maybe there are some problems with xcode 4 and ASIHTTPRequest too... – JRafaelM Aug 18 '11 at 15:53
  • I use Xcode 4 with ASIHTTPRequest. There are many JSON libraries as well. In my current project I am using yajl-objc http://gabriel.github.com/yajl-objc/ – Peter DeWeese Aug 18 '11 at 16:01
  • You need to carefully go through the setup instructions for each of these libraries or they won't work. You will also need to post your actual errors and issues for people to be able to help you further. – Peter DeWeese Aug 18 '11 at 16:03
  • I've been through all of these instructions: http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/#adding_build_target_dependencies – JRafaelM Aug 18 '11 at 16:38
  • when I try to #import "ASIHTTPRequest.h" it says there is no such file or directory.. – JRafaelM Aug 18 '11 at 16:39
  • It sounds like you didn't add it or didn't include it in your target. Start with these instructions: http://allseeing-i.com/ASIHTTPRequest/Setup-instructions – Peter DeWeese Aug 18 '11 at 18:40
  • Peter, are u sure this instructions are for xcode 4 ? my xcode doesn't have a tab called "project" – JRafaelM Aug 19 '11 at 11:23
  • I finnaly made it to import the ASIHTTP classes ... it was missing other framework dependencies... like CFNetwork and stuff... thx for helping guys – JRafaelM Aug 19 '11 at 12:11
  • This library seems abandoned – Pierre de LESPINAY Jan 15 '13 at 11:45
  • A lot of people have moved to restkit and mknetworkkit but there are good forks, and a couple times a year it seems that they pull changes in. Personally, I'd rather have an api more like backbone. – Peter DeWeese Jan 15 '13 at 14:15
  • 1
    The now selected answer regarding NSURLConnection and NSJSONSerialization is correct at this time. ASI became antiquated and built in tools got better. – Peter DeWeese Oct 02 '13 at 14:55
5

You can use rest kit api for that. You find the details about the rest kit in followings link https://github.com/RestKit/RestKit

NSCry
  • 1,662
  • 6
  • 23
  • 39
4

I can suggest standard iOS classes such as NSURLConnection and NSJSONSerialization.

Here is a series of posts that explains how to use Blocks to asynchronously perform Http requests against a RESTful API: http://kerkermeister.net/series/ios-and-rest-http-connections/

brazo
  • 704
  • 4
  • 11