• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Load View from .nib in Bundle.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Load View from .nib in Bundle. (From: Totte <email@hidden>)

  • Prev by Date: Re: can I change the cursor to wait cursor?
  • Next by Date: Re: Simple C++/Obj-C question, solved
  • Previous by thread: Load View from .nib in Bundle.
  • Next by thread: How to hide NSButton?
  • Index(es):
    • Date
    • Thread