1. Getting RubyObjC

RubyObjC is distributed as a Ruby Gem. To get it, use the following command:
sudo gem install rubyobjc --source http://www.rubyobjc.com

This will install the RubyObjC libraries as universal binaries.

To use RubyObjC from the IRB (Interactive Ruby) console, simply start IRB with the following options:
irb -r rubygems -r objc
You can then begin using RubyObjC to directly interact with the Objective-C runtime and Objective-C classes. For example, the following command lists all of the Objective-C classes currently loaded into the runtime:
irb(main):001:0> ObjC::Class.each {|c| puts c}

To create a skeletal RubyObjC application, use the rubyapp command, which is distributed as a part of the RubyObjC gem.

% rubyapp myapp

This creates an application directory named “myapp” with the necessary sources and Rakefile to build a basic Cocoa application.

Did you find an error? Is something missing? Post your comment or suggestion below!

Comments (0) post