From: Knud H. M. <knu...@de...> - 2008-04-14 11:52:30
|
Am 14.04.2008 um 12:20 schrieb Ferhat Ayaz: > are you sure that [dataSource dimensions]; returns an NSSize? No, I can't be - Ruby methods don't define a return type. The error already happens at compile time, not at runtime. Knud > > > Ferhat > > ----- Original Message ---- > From: Knud Hinnerk Möller <knu...@de...> > To: rub...@li... > Sent: Monday, April 14, 2008 12:56:52 PM > Subject: [Rubycocoa-talk] Importing Ruby Classes into Obj-C code > > Hi, > > please forgive me if this is a stupid question to ask, but is it > possible to import a Ruby class definition into Obj-C? What I mean is > this: > > I have a RubyCocoa class: > > class KNTiledMap < OSX::NSObject > attr_accessor :dimensions > ... > end > > I have an Obj-C class in which I want to use the Ruby class: > > @interface KNTileView : NSView { > KNTiledMap *dataSource; > } > > @implementation KNTileView > ... > NSSize originalSize = [dataSource dimensions]; > ... > @end > > This leads to a compile "error: invalid initializer". > > How can I make this work? > > Cheers, > Knud > ------------------------------------------------- > Knud Möller, MA > +353 - 91 - 495086 > Smile Group: http://smile.deri.ie > Digital Enterprise Research Institute > National University of Ireland, Galway > Institiúid Taighde na Fiontraíochta Digití > Ollscoil na hÉireann, Gaillimh > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk ------------------------------------------------- Knud Möller, MA +353 - 91 - 495086 Smile Group: http://smile.deri.ie Digital Enterprise Research Institute National University of Ireland, Galway Institiúid Taighde na Fiontraíochta Digití Ollscoil na hÉireann, Gaillimh |