• 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: Allocating outlets from NIB file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allocating outlets from NIB file


  • Subject: Re: Allocating outlets from NIB file
  • From: Andy Lee <email@hidden>
  • Date: Tue, 24 Jun 2008 08:56:16 -0400

On Jun 24, 2008, at 8:17 AM, Joseph Ayers wrote:
SpriteController and SpriteView are defined and connected in the NIB

Your nib shouldn't contain a SpriteController instance. Instead, it should set the class of File's Owner to SpriteController and make the outlet connection from File's Owner to your SpriteView. Your code below will then do the right thing -- it creates a SpriteController instance and tells the nib file to use that as the File's Owner when it is loaded.


When I open the NIB with

-(void)loadSpriteController{
if (spriteController == NULL) {
spriteController = [[SpriteController alloc] init];
if (![NSBundle loadNibNamed:@"spriteWindow" owner:spriteController]) {
NSLog(@"Error loading SpriteController");}
else{
NSLog(@"SpriteController NIB Loaded"); }
}


}


--Andy

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Allocating outlets from NIB file (From: Joseph Ayers <email@hidden>)

  • Prev by Date: Seconds since system startup
  • Next by Date: Re: Seconds since system startup
  • Previous by thread: Re: Allocating outlets from NIB file
  • Next by thread: Seconds since system startup
  • Index(es):
    • Date
    • Thread