[Rubycocoa-devel 567] Re: rubycocoa 0.9 questions and confusions

Back to archive index

jeanp****@gmail***** jeanp****@gmail*****
Fri Jan 5 09:22:47 JST 2007


On 1/4/07, Laurent Sansonetti <lsans****@apple*****> wrote:
>
>
> On Jan 5, 2007, at 12:31 AM, Tim Burks wrote:
> > I've found the same problem, it's related to the trick that is being
> > used to automatically import the class.  When it automatically
> > imports a class in a class declaration, the wrong class is used when
> > the body of the class is parsed.
> >
> > For example, add this "puts" to your code and rerun it (or use
> > OSX.NSLog).
> >
> >>   class OSX::SchoolKid
> >         puts self.superclass
> >>     def saySomething
> >>       puts "hi"
> >>     end
> >>   end
> >
> > You'll probably see that it's "Object" instead of OSX::NSObject.
>
> Ah this is indeed another problem that should also be addressed. But
> the original problem (overriding methods directly in the class) is
> still pertinent, RubyCocoa doesn't allow it yet.


if it would be helpful, i can file it as a bug/ER.

even after i explicitly ns_import :SchoolKid, i wasn't able to override the
method and instead got a runtime error:
  RuntimeError: could not add 'saySomething' to class '': Objective-C cannot
find it in the superclass

thanks for the help.
cheers,
jean-pierre
-------------- next part --------------
An HTML attachment was scrubbed...
下載 


More information about the Rubycocoa-devel mailing list
Back to archive index