• 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: changing entire content view of an NSWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing entire content view of an NSWindow


  • Subject: Re: changing entire content view of an NSWindow
  • From: Enrique Zamudio <email@hidden>
  • Date: Tue, 15 May 2001 17:14:09 -0500
  • Organization: Nasoft

Are you sure the nib is loading correctly? have you tried printing the NSView or something?
try something like NSLog(@"myView=%@", otherView) after getting the view. Maybe you're not
loading the nib the way you should or something.

I think the easiest way is to just call

[NSBundle loadNibNamed:@"MyNib" owner:self];

which will look for MyNib.nib on the bundle containing the class of the object passed as
owner. So the bundle in which you have the component's class should also have the nib...

Andreas Wolf wrote:

> Now, in my real app I want to set the bundle's view to the app's window
> content view (or NSBox contentView, or whatever)
>
> Class componentClass;
> id component;
> NSView *otherView;
>
> NSBundle *bundle = [NSBundle bundleWithPath:@"otherapp.bundle"];
>
> if(componentClass =[bundle principalClass])
> {
> component = [[componentClass alloc] init];
>
> [component loadNib:self]; // tell otherapp to load its nib
> otherView = [component getView:nil]; // get otherapp's view
>
> [myNSBox setContentView: otherView];
>
> [myNSBox display];
> }
>
> The bundle loads correctly and it starts up, because I instantiate it,
> but it does not display it's view in my apps view,
> regardless of wether I set it to the windows content view or to an
> NSBox's content view.


References: 
 >Re: changing entire content view of an NSWindow (From: Andreas Wolf <email@hidden>)

  • Prev by Date: Still having problume with Security API
  • Next by Date: Re: Still having problume with Security API
  • Previous by thread: Re: changing entire content view of an NSWindow
  • Next by thread: mathematical functions?
  • Index(es):
    • Date
    • Thread