K
Kevin Lanik
I'm new to ruby and trying to embed it in some objective-c using
rubycocoa. I can get my .rb to run using
RBRubyCocoaInit();
NSString *path = [[NSBundle mainBundle] pathForResource"xyz"
ofType"rb"];
NSString *fileContents = [NSMutableString
stringWithContentsOfFileath];
[RBObject RBObjectWithRubyScriptString:fileContents];
This works just fine, but I'm getting strange errors if I want to use
any NSObjects. The odd part is that NSLog still works from inside ruby.
If i put OSX::NSLog("xyz"), I get xyz on the console like I should. If
i put myObject = OSX::NSObject.alloc.init I get the error
uninitialized constant OSX::NSObject
If I try to require 'osx/cocoa' the app crashes (it doesn't even catch
in my ruby exception handling) What am I missing?
Thanks,
Kevin
rubycocoa. I can get my .rb to run using
RBRubyCocoaInit();
NSString *path = [[NSBundle mainBundle] pathForResource"xyz"
ofType"rb"];
NSString *fileContents = [NSMutableString
stringWithContentsOfFileath];
[RBObject RBObjectWithRubyScriptString:fileContents];
This works just fine, but I'm getting strange errors if I want to use
any NSObjects. The odd part is that NSLog still works from inside ruby.
If i put OSX::NSLog("xyz"), I get xyz on the console like I should. If
i put myObject = OSX::NSObject.alloc.init I get the error
uninitialized constant OSX::NSObject
If I try to require 'osx/cocoa' the app crashes (it doesn't even catch
in my ruby exception handling) What am I missing?
Thanks,
Kevin