Re: Allocating outlets from NIB file
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