Re: Example code eyePhoto-Step8 & IB help needed
Re: Example code eyePhoto-Step8 & IB help needed
- Subject: Re: Example code eyePhoto-Step8 & IB help needed
- From: Eric Matecki <email@hidden>
- Date: Wed, 21 Dec 2011 10:35:59 +0100
On 20/12/11 17:48, Laurent Daudelin wrote:
On Dec 20, 2011, at 06:03, Eric Matecki wrote:
Hi,
I'm new to IB.
I'm trying to find by which magic "NSWindow * imageCaptureWindow;",
member of "@interface Controller : NSWindowController",
gets initialized by the following code :
[NSBundle loadNibNamed: @"ImageCapture" owner: self];
This variable isn't initialized anywhere in the code, so it must be IB
which does it. But, contrary to the window's views, it isn't even an IBOutlet.
The only connection/binding/whatever I can see in IB for this window is
the delegate to "point to" the owner, which is the previously mentionned Controller.
Also, for the "Device Browser View", where in IB can I find how "mode" is set to "IKDeviceBrowserViewDisplayModeTable" ?
I (think I) do understand how bindings works, but not how to retrieve the pertinent information in IB...
Any help would be appreciated, IB is so mysterious to me !
Salut Eric.
I'm sure that there are some who will be able to better explain it than myself but, to make a long story short, when you call loadNIbNamed:, the method will connect all the instance variables of the "owner" that you have declared to be IB outlets with the UI objects that you did create in IB, after they are instantiated. How does the method do that? If they are no setter for a particular ivar, it will just set the ivar directly. This is also probably explained in the documentation.
HTH!
-Laurent.
Salut Laurent,
that's what I did understand, but...
Somewhere in IB I should find the name of that instance variable ("imageCaptureWindow"),
so loadNibNamed: knows *which* variable to assign to, which I don't find.
To establish myself a connection, the instance variable has to have the IBOutlet attribute,
which "imageCaptureWindow" lacks.
Let's look at the scannerView. The ivar is declared as "IBOutlet IKScannerDeviceView * scannerView",
and in IB I can see a connection in "Referencing Outlets", that's called "scannerView", of/to the "File's Owner".
That's clear to me.
I expect to find something similar for the window, but I don't...
Yet it works... but I can't figure out how.
Thanks.
--
Keep intel OUTSIDE my Mac !
Hiii !!! I can see Intel chips creeping around my G5 !
Eric M.
_______________________________________________
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