I am looking at a project that will load custom NSBundles that include NSViewController. In my main program, I have this code to work with the package after downloading it ...
id principalClass = [loadedBundle principalClass];
id instance = [[principalClass alloc] init];
[localLabel setStringValue:[instance name]];
NSView *incomingView = [[instance viewController] view];
[localView addSubview:incomingView];
[localView display];
And the init method of the main classes in the bundle looks like this:
-(id) init {
if(self = [super init]){
name = @"My Plugin";
viewController = [[ViewController alloc] initWithNibName:@"View" bundle:nil];
}
return self;
}
View.nib is the nib located in the bundles project. But whenever I download a package, I get this error ...
2010-05-27 09: 11: 18.423 PluginLoader [45032: a0f] could not find nib named: View in bundle of packets: (null) 2010-05-27 09: 11: 18.424 PluginLoader [45032: a0f] - [NSViewController loadView ] failed to load "View" nib.
, , [label setStringValue:[instance name]]; . , , , . , "" ?
!