ObjectiveResource is a port of Rails’ ActiveResource framework to Objective-C.
The primary purpose of this project is to quickly and easily connect
iPhone applications with servers running Rails.
This project relies on ObjectiveSupport, which aims to provide some popular
Rubyisms to Objective-C. If you checkout this project using git, you can
pull down ObjectiveSupport by doing a “git submodule init” followed by
a “git submodule update”.
This project comes bundled with a sample iPhone application and a sample
Rails application. To see how everything works together you can open
up the .xcodeproj and fire up a rails server in sample_rails_app.
This integration requires a little more up-front configuration in your Xcode project, but in exchange, it gives you the ability to easily update to the newest version of ObjectiveResource.
- Download (clone) the objectiveresource project. Put this in a “good” location that is reasonably sharable by all your projects (e.g. “/Users/myusername/work/objectiveresource”)
- If you do a git clone, you will need to follow it up with “git submodule init” and “git submodule update”
- Open your iPhone project in Xcode
- Drag objective_resource.xcodeproj from the Finder into the top level of your iPhone project in Xcode.
- Select the new objective_resource.xcodeproj element in your project, so that its “parts” (really its build targets) appear in the Detail tab. Click the checkbox for libObjectiveResource.a, which adds it to your app target.
- Open the Info panel for the root of your project. Switch to the Build tab, and make sure All Configurations is selected in the Configuration popup. You’ll need to customize two things here:
- Search for the User Headers item, and add the path to your clone of the project (e.g. “/Users/myusername/work/objectiveresource”). Click the checkbox to make it recursive.
- Search for the Other Linker Flags item, and add the following: -ObjC -all_load
Later, when new versions of ObjectiveResource are available, you can simply get the changes from github, and then rebuild your apps; No need to worry about files in ObjectiveResource or ObjectiveSupport that may have been added, renamed, etc, since all that will be taken care of in the objective_resource Xcode project you get from github.
- Download (clone) the objectiveresource project
- If you do a git clone, you will need to follow it up with “git submodule init” and “git submodule update”
- open the .xcodeproj in XCode for both objectiveresource and your iPhone project
- drag the ObjectiveResource and ObjectSupport groups from the objectiveresource project onto your iPhone project, making
sure to check the “copy files” box.
Unit testing makes use of the SenTest work-alike from Google Toolbox for Mac.
To run the tests, select the “Unit Tests” target in XCode and Build and Run.
You will need to have Rails installed along with the populator and faker
gems, as the project uses a “Run Script” to setup a local Rails
server for testing.