Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate RestKit Framework (restkit.org) with xCode 4?

I followed the instructions on the github page but something is wrong (most certainly is me: P) but, Do you know about any good tutorial for integrate / use in Xcode4 RestKit?

Thanks!

like image 795
Guerrix Avatar asked Apr 28 '11 01:04

Guerrix


3 Answers

Download the latest version from this Link http://restkit.org/

and extract the zip folder and you will find a ReadMe.md file which explains you steps to install for Xcode 4.x as shown below

Xcode 4.x (Git Submodule)

  1. Add the submodule: git submodule add git://github.com/RestKit/RestKit.git RestKit
  2. Open the project you wish to add RestKit to in Xcode.
  3. Focus your project and select the "View" menu > "Navigators" > "Project" to bring the project file list into view.
  4. Drag the RestKit.xcodeproj file from the Finder and drop it on your "".xcodeproj.
  5. Click on your project's name in the sidebar on the left to open the project settings view in the right pane of the window.
  6. In the middle pane you will see PROJECT and TARGETS headers for your project. Click on your project name, then select Build Settings along the top to open the Build Settings editor for your entire project.
  7. Find the Header Search Paths setting. Double click and add a new entry. Add a search path to the "$(SOURCE_ROOT)/RestKit/Build" directory you have added to your project. DO NOT check the Recursive checkbox.
  8. Find the Library Search Paths setting. Double click and add a new entry. Add a search path to the "$(SOURCE_ROOT)/RestKit/Build/$(BUILD_STYLE)-$(PLATFORM_NAME)" directory you have added to your project.
    NOTE: This is only necessary if you are NOT using DerivedData.
  9. Find the Other Linker Flags entry and double click it. Use the + button to add a new entry and enter -ObjC -all_load. Dismiss the editor with the Done button.
  10. Locate the target you wish to add RestKit to in the TARGETS list in the middle of the editor pane. Select it to open the target settings editor in the right pane of the window.
  11. Click the Build Phases tab along the top of the window to open the Build Phases editor.
  12. Click the disclosure triangles next to the Target Dependencies and Link Binary with Libraries items.
  13. In the Target Dependencies section, click the + button to open the Target selection sheet. Click on the RestKit aggregate target (it will have the bulls-eye icon) and click the Add button to create a dependency.
  14. In the Link Binary with Libraries section, click the + button to open the Library selection sheet. Here we need to instruct the target to link against all the required RestKit libraries and several system libraries. Select each of the following items (one at a time or while holding down the Command key to select all of them at once) and then click the Add button:
    • libRestKitCoreData.a - Optional. Only necessary if you are using Core Data.
    • libRestKitJSONParserJSONKit.a
    • libRestKitNetwork.a
    • libRestKitObjectMapping.a
    • libRestKitSupport.a
    • CFNetwork.framework
    • CoreData.framework - Optional. Only necessary if you are using Core Data
    • MobileCoreServices.framework
    • SystemConfiguration.framework
    • libxml2.dylib - Optional. Only necessary if you are mapping from XML payloads and link libRestKitXMLParserLibxml.a into your app.
  15. Verify that all of the libraries are showing up in the Link Binary with Libraries section before continuing.

Congratulations, you are now done adding RestKit into your Xcode 4 based project!

You now only need to add includes for the RestKit libraries at the appropriate places in your application. The relevant includes are:

#import <RestKit/RestKit.h>
// And if you are using Core Data...
#import <RestKit/CoreData/CoreData.h>
like image 192
Nakkeeran Avatar answered Oct 27 '22 01:10

Nakkeeran


I found this tutorial very useful to make it work on xCode 4.0.

http://liebke.github.com/restkit-github-client-example/

like image 44
itsaboutcode Avatar answered Oct 27 '22 01:10

itsaboutcode


I did my build following this steeps https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x and guoleii is right. But I needed to change the owner directory.

like image 31
Xus Avatar answered Oct 27 '22 00:10

Xus