I created a framework and added a xib file named "MyXibFile". I created a separate application and added this framework to it. I want to load this .xib
file to display the window from it.
I am using the following code snippet which is not working
-(void)launchDownloaderWindow
{
if (![NSBundle loadNibNamed:@"Download" owner:self])
{
NSLog(@"Nib loading failed");;
}
[appWindow makeKeyAndOrderFront:nil];
}
I can see the message in the console "Nib loading failed" Any suggestion how to solve this?
I can think of a slightly different way of doing this. In your created framework create a class, possibly an
NSWindowController
, and have it load and return the window for you. For example after importing the framework you could initialize your window controller and create a strong reference to the window it creates.WindowController.m
MyApp.m