[MacRuby-devel] MacRuby classes delete/overwrite Objective-C classes?

Caio Chassot lists at caiochassot.com
Sat Feb 12 03:55:51 PST 2011


On 2011-02-12, at 04:40 , Caio Chassot wrote:
> 
> On 2011-02-12, at 01:59 , Robert Payne wrote:
>> 
>> The behavior I'm expecting is to see "Hello world" in the console but it seems as if the entire Objective-C method was deleted. I don't have a method in the Ruby class called helloWorld.

Here's a terser, simpler example:

    $ cat foo.m
    #import <Foundation/Foundation.h>
    @interface Foo : NSObject {}
    -(NSString*) helloWorld;
    @end

    @implementation Foo
    -(NSString*) helloWorld {
      return @"hello";
    }
    @end

    void Init_foo(void) {}

    $ clang -o foo.bundle foo.m -fobjc-gc-only -bundle -framework Foundation

    $ macruby -rfoo -e 'class Foo; end; puts Foo.new.helloWorld'
    hello



More information about the MacRuby-devel mailing list