From: Aidan R. <ai...@yo...> - 2006-01-06 16:01:30
|
Hi Jonathan, I'm trying to wrap a class from one of Apple's frameworks that's not yet supported by RubyCocoa. If successful, I'd be keen to share it out with everyone else :-) Aidan On 06/01/2006, at 11:07 PM, Jonathan Paisley wrote: > > On 3 Jan 2006, at 22:07, Aidan Rogers wrote: > >> How do I go about wrapping an existing ObjC class? Is there an >> example somewhere I can work from, or some documentation? > > Could you be more specific about what you're trying to do? Is it a > class from AppKit/Foundation you want to deal with that's not yet > supported in RubyCocoa, or some ObjC class of your own devising? If > it's the latter, you can pretty much just use it like this: > > # Do this once to create the Ruby classes corresponding to the > ObjC classes > OSX.ns_import :YourClassName > > # Then use the class > obj = OSX::YourClassName.alloc.init > obj.someMethod("hello") > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through > log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD > SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > |