Seems there are a couple other threads on here about RestKit and Xcode
4 but I ran into some different issues and wanted to share how I went
about getting things building. I have chosen to go the workspace
route with Xcode 4 and overall it makes things pretty simple. There
are a few gotchas though.
Here is my setup:
Project Workspace
---> My App
---> RestKit (twotoasters, 0.9)
---> Three20 (twotoasters, master)
Once you have the three projects in the workspace, you can just go
into the 'Link Binary with Libraries' build phase of your app target
and pull in the required libraries from RestKit and Three20. This
results in the libraries being built/linked, and hence all the classes
enclosed in the include libraries to be built in the common Derived
Data Products directory. I ran into the follow two problems:
1) Since RestKit.h is actually not included in any of the libraries,
it is not compiled/copied into the mentioned build dir. I added a new
copy files phase to the RestKitObjectMapping target to copy RestKit.h
into the build dir (New Copy Files Phase, Products Directory, Subpath:
include/RestKit, File: RestKit.h) Note: It seems like you should be
able to use Target Dependencies to solve this issue (app project
depends on RestKit target of RestKit project, but for some reason
Xcode 4 does not allow you to add the dependency or any dependency for
that matter)?
2) The new JSONKit seems to have chosen a new 'Public Headers Folder
Path' in its build settings, I changed this back to match the approach
of the rest of the targets (include/RestKit/Support/JSON/JSONKit).
Finally, I included the following imports in my main project:
#import <Three20/Three20.h>
#import <RestKit/RestKit.h>
#import <RestKit/CoreData/CoreData.h>
#import <RestKit/Support/JSON/JSONKit/JSONKit.h>
#import <RestKit/Three20/Three20.h>
That is it, project is building great. Now if Apple would just
release an Xcode 4 that actually indexes properly so code completion/
highlighting would work, I would be a happy camper.
Hope it helps,
Chad Podoski
Shacked Software
getshacked.com