If you are having trouble with your RestKit installation, try the troubleshooting steps below....
If the import of the RestKit header fails, your project may not be building using the Derived Data directory. Beginning with Xcode 4.0, projects and workspaces can place their build products into a common tree of directories outside of the project source tree. RestKit leverages this build environment to provide header include paths.
Select the File > Project Settings… menu item to open the project settings sheet:
A sheet will appear containing a Build and a Snapshots tab. On the Build tab, select the Advanced… button:
A new sheet will appear containing a pop-up menu for the Build Location. Select the Derived Data Location from the menu and then press the Done button to dismiss the sheet.
Note: As of xCode 4.5 the screenshot does not match the one below... Your options now are "() Unique, () Shared Folder, () Custom [Relative to derived directory], and () Legacy". Have tried both the default () Unique, and "() Custom [Relative to derived directory] and neither has solved the Archive problem (Build works fine, but Archive results in file not found on #import )
Note 2: In xCode 4.5.1 I used the ![Open Workspace Settings] and in the Build Location set (*) Unique and this all built.
If you set up RestKit in your project using git it is likely that you're compiling against the master branch, which can be unstable. Instead, try checking out the last known stable release using tags:
RestKit (master)$ git tag -l 0.9.0 0.9.1 0.9.1.1 0.9.2 0.9.3 RestKit (master)$ git checkout 0.9.3 Note: checking out '0.9.3'. You are in 'detached HEAD' state. You can look around, make experimental...
Xcode 4 is known to suffer from a variety of code completion indexing issues that pop up from time to time. If your code completion stops working, there are a few things that may help:
Hold down the option key and select the Product menu > Clean Build Folder… option to rebuild your indexes.
Deploy the nuclear option by completely rebuilding the Derived Data directory for your project. To do this, close out your project in Xcode and then display the Organizer by selecting the Window menu > Organizer. Find your project in the list on the left and click it. Find the Delete… button in the main panel on the right of the window. Now quit Xcode, relaunch it and reopen your project. The index will rebuild and your code completion may return.
Xcode's indexing issues are seemingly aggravated by certain configurations. It is recommended that you update your application's project configuration in the following ways:
$(SOURCE_ROOT)environment variable to construct an absolute path that is nested underneath your project's root directory. So rather than adding a Header Search Path to
../Libraries/, change it to
../Libraries/, change it to
If you are using the GCC compiler then switching to LLVM may alleviate your indexing issues.
If your project is old, then you may eliminate some indexing weirdness by updating to the Xcode 3.2 format. This is done by by selecting the View > Navigators > Project Navigator menu item, then showing the Utilities in the right hand panel by selecting the View > Utilities > Show Utilities and clicking on your project in the Project navigator panel on the left of the Xcode window. In the right panel, you will see a Project Format menu. Select Xcode 3.2-compatible.
After adding RestKit to my project, I have these static libraries appearing in red in my project. What gives?
Since the release of Xcode 4 this annoyance has been around. Though the libraries appear in red, they actually build and are linked correctly into your application. If you have no other problems, this can safely be ignored as a cosmetic issue. We recommend hiding them in a group in your project like Frameworks.
As of beta 7, Xcode 4.2 no longer seems to suffer from this issue and does not add red static library build products to your application's project. You may need to explicitly delete them and re-add to your project to remove them after updating.
Be sure that you are linking against the appropriate build product for your platform.
On iOS, you want libRestKit.a. On OS X, you want RestKit.framework.
Xcode may fail to execute the shell scripts at the end of the RestKit build process if Git is configured to use
core.autocrlf. The script files in the repository have Unix line endings and will be mangled if autocrlf is enabled. If you run into this issue, reconfigured git to use