Re: MyDocument's Window Outlet...
Re: MyDocument's Window Outlet...
- Subject: Re: MyDocument's Window Outlet...
- From: Alexander Spohr <email@hidden>
- Date: Thu, 13 Nov 2008 09:31:31 +0100
Am 12.11.2008 um 19:22 schrieb Jean-Nicolas Jolivet:
[window setToolbar:] for example gives me an error saying that
"window" wasn't declared....
try [[self window] setToolBar:]
If I try to declare a "window" outlet in my code and try to connect
it in IB, I end up with 2 outlets named "window"...
You don’t want that :)
Of course the easy work around was to declare a new outlet that I
named "mainWindow" and connected to my file owner, that way I can
access the main window from my code...
Don’t fight the framework. If you think it feels wrong, it is.
but still I was wondering why it is not possible to access the
"window" outlet that is created automatically with every new
"Document Based" project...? What's the use of this outlet if I
can't access it in my code?
An outlet can be an ivar. But his might be private to your superclass.
Always use [self ivar] to access them as someday someone might
override the method.
In your example you could use
NSWindow *aWindow = [self window]
if you want to do use the window more than one line of code.
atze
_______________________________________________
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