1. Getting RubyObjC
1.1 Download the Gem
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.
1.2 Using RubyObjC from IRB and Ruby scripts
To use RubyObjC from the IRB (Interactive Ruby) console, simply start IRB with the following options:
irb -r rubygems -r objcYou 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}
1.3 Building a skeleton RubyObjC application
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