Re: Allocating outlets from NIB file

2008-06-24 Thread Ken Thomases
On Jun 24, 2008, at 7:43 AM, Johan Kool wrote: You create your controller with this: spriteController = [[SpriteController alloc] initWithWindowNibName:@"YourNib"]; and to show the window you use: [[spriteController window] makeKeyAndOrderFront:self]; or [[spriteController spriteWindow] make

Re: Allocating outlets from NIB file

2008-06-24 Thread Andy Lee
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 Owne

Re: Allocating outlets from NIB file

2008-06-24 Thread Chris
Hi, You should not be allocating either SpriteView or SpriteController if they are referred to in the NIB. (which is the normal case). Instead you go to the File's Owner object in interface builder, and go to the Identity tab, and set the Class to be whatever class contains your loadNib

Re: Allocating outlets from NIB file

2008-06-24 Thread Johan Kool
You do not allocate outlets. Outlets point to instances in your nib. These instances are instantiated(/allocated) when the nib is loaded. You usually set the File's Owner to be a your own subclass of NSWindowController. Next control-drag from the File's Owner icon to the window and the view

Allocating outlets from NIB file

2008-06-24 Thread Joseph Ayers
I am quite confounded with regard to how/when to allocate outlets which are classes existing as instances in another class. Consider @interface SpriteController : NSWindowController { IBOutlet SpriteView* spriteView; IBOutlet NSWindow* spriteWindow; } SpriteController* spriteController;