FROM : Guy English
DATE : Thu Dec 23 22:57:15 2004
Hey Boisy,
In your VirtualDriveController.h you'll need:
IBOutlet NSView *virtualDriveView;
Drag VirtualDriveController.h into the instances pane in Interface
Builder - that lets IB know all about your controller class - even
though you're not actually going to make an instance of it.
Select the File's Owner in IB and open the inspector to Custom
Class ( Apple-5 I think, not in front of a Mac right now. ) From the
list of classes displayed select VirtualDriveController.
Now you can drag a line from your File's Owner to the view and
connect it to vritualDriveView.
When you call [NSBundle loadNibNamed: @"VirtualDriveView" owner:
self] the bundle loading code will connect your controllers
virtualDriveView instance variable to the view you tied it to in IB.
File's Owner is a stand in for the owner: argument in the call above.
I'm not really sure why Stephane suggests not initing the
controller. I think that's just what he does in his code. The only
reason I can think of is that you may (well, will) get two
awakeFromNib: calls. One when your VirutalDriveController awakes from
the nib it's stored in and another when it loads it's Nib and
awakeFromNib gets called on File's Owner ( it's a proxy remember ).
Anyway if you know that it should be easy enough to deal with.
Hope that helps,
Guy
On Thu, 23 Dec 2004 13:20:36 -0600, Boisy G. Pitre <<email_removed>> wrote:
>
> On Dec 23, 2004, at 9:17 AM, stephane sudre wrote:
> > In the code, when you call [NSBundle loadNibNamed:@"VirtualDriveView"
> > owner:myOwner]
> >
> > myOwner must be an instance (not initialized but allocated) of the
> > class of File's owner.
> >
> > This way after the call, myOwner is the File's owner instance and
> > inherits its connexions.
>
> So do I need three sets of files?
>
> VirtualDriveController.h/VirtualDriveController.m (already have)
> VirtualDriveModel.h/VirtualDriveModel.m (already have)
> VirtualDriveView.h/VirtualDriveView.m (don't have yet)
>
> And the owner should be an allocated (but not inited) instance of my
> VirtualDriveView class?
> --
> Boisy G. Pitre
> E-Mail: <email_removed>
> Mobile: (337) 781-3997
> Web: www.boisypitre.com
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
DATE : Thu Dec 23 22:57:15 2004
Hey Boisy,
In your VirtualDriveController.h you'll need:
IBOutlet NSView *virtualDriveView;
Drag VirtualDriveController.h into the instances pane in Interface
Builder - that lets IB know all about your controller class - even
though you're not actually going to make an instance of it.
Select the File's Owner in IB and open the inspector to Custom
Class ( Apple-5 I think, not in front of a Mac right now. ) From the
list of classes displayed select VirtualDriveController.
Now you can drag a line from your File's Owner to the view and
connect it to vritualDriveView.
When you call [NSBundle loadNibNamed: @"VirtualDriveView" owner:
self] the bundle loading code will connect your controllers
virtualDriveView instance variable to the view you tied it to in IB.
File's Owner is a stand in for the owner: argument in the call above.
I'm not really sure why Stephane suggests not initing the
controller. I think that's just what he does in his code. The only
reason I can think of is that you may (well, will) get two
awakeFromNib: calls. One when your VirutalDriveController awakes from
the nib it's stored in and another when it loads it's Nib and
awakeFromNib gets called on File's Owner ( it's a proxy remember ).
Anyway if you know that it should be easy enough to deal with.
Hope that helps,
Guy
On Thu, 23 Dec 2004 13:20:36 -0600, Boisy G. Pitre <<email_removed>> wrote:
>
> On Dec 23, 2004, at 9:17 AM, stephane sudre wrote:
> > In the code, when you call [NSBundle loadNibNamed:@"VirtualDriveView"
> > owner:myOwner]
> >
> > myOwner must be an instance (not initialized but allocated) of the
> > class of File's owner.
> >
> > This way after the call, myOwner is the File's owner instance and
> > inherits its connexions.
>
> So do I need three sets of files?
>
> VirtualDriveController.h/VirtualDriveController.m (already have)
> VirtualDriveModel.h/VirtualDriveModel.m (already have)
> VirtualDriveView.h/VirtualDriveView.m (don't have yet)
>
> And the owner should be an allocated (but not inited) instance of my
> VirtualDriveView class?
> --
> Boisy G. Pitre
> E-Mail: <email_removed>
> Mobile: (337) 781-3997
> Web: www.boisypitre.com
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
>
| Related mails | Author | Date |
|---|---|---|
| Boisy G. Pitre | Dec 23, 15:17 | |
| stephane sudre | Dec 23, 15:21 | |
| Boisy G. Pitre | Dec 23, 16:01 | |
| stephane sudre | Dec 23, 16:17 | |
| stephane sudre | Dec 23, 16:22 | |
| Faizel Dakri | Dec 23, 16:31 | |
| Boisy G. Pitre | Dec 23, 20:20 | |
| Guy English | Dec 23, 22:57 | |
| Boisy G. Pitre | Dec 24, 19:09 | |
| mmalcolm crawford | Dec 24, 23:16 |






Cocoa mail archive

