A port of Ruby on Rails' ActiveResource to Objective-C (and specifically the iPhone)
Objective-C Ruby Other
Pull request Compare This branch is 5 commits ahead of yfactorial:1.1.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Classes
google_toolbar/UnitTesting
google_toolbox
objective_resource.xcodeproj
sample_rails_app
.gitignore
.gitmodules
AddDogView.xib
Coverage.plist
EditDogViewController.xib
Info.plist
LICENSE
MainWindow.xib
README.textile
Unit Tests-Info.plist
ViewDogController.xib
main.m
objective_resource_Prefix.pch
package_zip.sh

README.textile

Overview

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”.

Getting Started

Sample Code

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.

Integrating with your project

The New Way (experimental)

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.

  1. 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”)
    1. If you do a git clone, you will need to follow it up with “git submodule init” and “git submodule update”
  2. Open your iPhone project in Xcode
  3. Drag objective_resource.xcodeproj from the Finder into the top level of your iPhone project in Xcode.
  4. 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.
  5. 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:
    1. 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.
    2. 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.

The Old Way

  1. Download (clone) the objectiveresource project
    1. If you do a git clone, you will need to follow it up with “git submodule init” and “git submodule update”
  2. open the .xcodeproj in XCode for both objectiveresource and your iPhone project
  3. drag the ObjectiveResource and ObjectSupport groups from the objectiveresource project onto your iPhone project, making
    sure to check the “copy files” box.

Contributing

Running Tests

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.