From: Jonathan P. <jp...@dc...> - 2006-11-02 16:31:44
|
On 23 Oct 2006, at 0:01, Rupert BARROW wrote: > I've just posted the following bug report on SourceForge : what do > you think about it ? > > > In Objective C : > NSBundle *currPlugin = [NSBundle bundleWithPath:currPath]; > Class currPrincipalClass = [currPlugin principalClass]; > > When I have defined a plugin with a main class which is a Ruby class, > this last call returns nil, even if the bundle's Info.plist is > correct, with principalClass well defined. I don't think this is going to work. RubyCocoa dynamically creates Objective C classes as you define them in code by subclassing OSX::NSObject. Therefore, the class you've named in the Info.plist doesn't exist until the necessary ruby code is executed. What steps have you taken to build your plugin? You might get things to work by using the '-init symbolname' argument to the linker in order to get a C function to be called when the dynamic library is loaded. That C function would, in turn, initialise RubyCocoa and load in your *.rb files. They would created the necessary Objective C classes. |