From: Sam Griffith Date: 2003-05-15T04:05:49+09:00 Subject: Re: Using Ruby-Cocoa - how to send a Obj-C object a msg? I figured out what I did wrong on the code below... I was sending to self, and should have been sending to the local mystring. require 'osx/cocoa' mystring = OSX::NSString.stringWithString("Hello") strLength = mystring.ocm_send(:length) puts strLength But part of the question still stands! How do I tell Ruby-Cocoa about a new Obj-C class that I've created and want to use from Ruby? Thanks for the time, -- Sam Griffith Jr. email: staypufd@mac.com Web site: http://homepage.mac.com/staypufd/index.html On 5/14/2003 1:40 PM, in article BAE7F7A2.1AEC1%staypufd@austin.rr.com, "Sam Griffith" wrote: > Hello, > > I'm using Ruby-Cocoa and I want to be able to include some of my own classes > that I've written in Obj-C and create instances of them in Ruby and then > send messages. > > I've looked in the /usr/lib/ruby/osx directory and found an oc_wrapper.rb > file that uses code something like the following: > > mystring = OSX::NSString.stringWithString("Hello") > strLength = self.ocm_send(:length) > puts strLength > > > Does anyone know exactly what modules/classes in need to require and the > correct way to use this to be able to access my Obj-C classes? > > Thanks for your time and help, >