Re: Load View from .nib in Bundle.
Re: Load View from .nib in Bundle.
- Subject: Re: Load View from .nib in Bundle.
- From: Tobias Hermann <email@hidden>
- Date: Tue, 27 May 2003 10:12:02 +0200
hi!
you can do the following:
The class which will load the nib should be the file's owner of the nib
file to load. it should have an IBOutlet to the view.
when you load the nib file with NSBundle's
loadNibNamed: @"yournib" owner: self
the outlet gets set properly and you can set the box's content view to
that outlet.
regards
tobi
On Tuesday, May 27, 2003, at 09:50 AM, Totte wrote:
Hello Cocoa gurus.
I'm playing around with the Bundle/Plugin architecture of Cocoa, and
got the loading to work properly (can call methods in the bundle, and
NSLog() says I'm there OK, but, I need to load a View from a Nib-file,
and install that into a NSBox passed from the calling main application,
and my primitive Cocoa experience makes me trip on the "simple" task of
loading a nibfile from within a Bundle (in the bundle principal class
itself). See the method below. Maybe I'm totally off here.
// Install inside
- (void)installViewIntoBox:(NSBox *)aBox
{
// Locals
NSView* myLoadedView;
// Magic code to load the view.
storyLineView = [someMagicCode here];
// Install into passed box
[aBox setContentView: myLoadedView];
}
// Totte
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.