#15 MetaProgramming on class derived from NSObject causes "Illeg

closed
kimura wataru
None
5
2005-10-04
2005-09-06
Rup
No

My problem is about meta-programming with classes derived from
NSObject (Cocoa). I am testing an example from the (great) Poignant's
Ruby Guide (see attachments of classes and test case).

When I run the test case with Meta not derived from OSX::NSObject (and
initialize a Klass instance with new), the results are OK.
When I run the same test case with Meta derived from OSX::NSObject (and
initialize with alloc.init), I get an illegal instruction and a CrashReport (not
displayed, but log file produced).

What is wrong with my code ?

Discussion

  • Rup
    Rup
    2005-09-06

    Meta and Klass, with unit test case (split into 2 files)

     
    Attachments
  • kimura wataru
    kimura wataru
    2005-09-16

    • assigned_to: nobody --> kimuraw
     
  • kimura wataru
    kimura wataru
    2005-09-16

    Logged In: YES
    user_id=919560

    Thanks,
    We accepted your report.

     
  • kimura wataru
    kimura wataru
    2005-09-30

    Logged In: YES
    user_id=919560

    It's a bug of RubyCocoa.

    Infinite loop occurs invoking the method "respondsToSelector:" of
    sub-subclass inherited from a Cocoa class.

    I wrote a ad-hoc patch for this problem to CVS HEAD(2005-09-27).
    I think there are more better solution on performance, I will test
    other ways.
    Please wait for a release of fixed version.

     
  • kimura wataru
    kimura wataru
    2005-10-01

    Logged In: YES
    user_id=919560

    It's a bug of RubyCocoa.

    Infinite loop occurs invoking the method "respondsToSelector:" of
    sub-subclass inherited from a Cocoa class.

    I wrote a ad-hoc patch for this problem to CVS HEAD(2005-09-27).
    I think there are more better solution on performance, I will test
    other ways.
    Please wait for a release of fixed version.

     
  • kimura wataru
    kimura wataru
    2005-10-02

    Logged In: YES
    user_id=919560

    sorry, I failed to upload the patch.

     
  • kimura wataru
    kimura wataru
    2005-10-02

     
    Attachments
  • kimura wataru
    kimura wataru
    2005-10-04

    • status: open --> closed
     
  • kimura wataru
    kimura wataru
    2005-10-04

    Logged In: YES
    user_id=919560

    This bug was fixed in CVS HEAD 2005-10-04.
    (framework/src/objc/OverrideMixin.m rev:1.8)

    Thanks for your repoting.