Xcode / Interface Builder creates nil binding of an NSTextField instance ...
Xcode / Interface Builder creates nil binding of an NSTextField instance ...
- Subject: Xcode / Interface Builder creates nil binding of an NSTextField instance ...
- From: Jay Reynolds Freeman <email@hidden>
- Date: Sat, 19 Jun 2010 16:15:08 -0700
I am running Xcode/Interface Builder 3.2.2, in MacOS 10.6.4, on a
MacPro 3,1, working on a project created in Xcode/IB 3.2.2. (Eg,
I have a .xib file, not a .nib file)
In IB, I drag an instance of NSTextField from the library onto my
window, and use control-drag to hook it up to as instance of
NSTextField in a controller, the instance being declared in that
controller's header file. The IB Connections Inspector indicates
that the binding is present and correct, and yes, I did remember
to save from IB.
On doing a clean and then a build of my project in Xcode, and then
launching the app, I find that the declared instance is nil in
"applicationDidFinishLaunching". That is, I instrumented along the
lines of "if( <that instance> == nil ) NSLog(...)".
I have played with several things, including breaking the binding
in IB, then saving, exiting IB, exiting Xcode, relaunching both of
them, remaking the binding, saving and building again. I have also
changed the name of the instance variable in question (and updated
and saved the .xib file), and have tried creating a second,
additional instance of NSTextField and made the binding to the new
instance. I still get the nil in "applicationDidFinishLaunching",
in all cases.
I also grepped through my project for the instance variable name,
and did not find any place where I had absentmindedly set it to
nil.
I have checked the web, and also checked the archives of this list
(though there are rather too many messages about NSTextField to do
the latter usefully).
I have a couple of other instances of NSTextField in my project,
also bound in Interface Builder, which behave correctly.
At risk of providing too much information, the declaration of the
instance variable in question is
IBOutlet NSTextField *ExpectStuff;
and the instrumentation code, in "applicationDidFinishLaunching",
is
if( ExpectStuff == nil ) // DEBUG
NSLog(@"ExpectStuff is nil in applicationDidFinishLaunching"); // DEBUG
The instance of NSTextField in question is located in the bottom
border (Content Border set to "Small Bottom Border") of my main
window; however, moving the instance to the non-border portion of
the main window does not solve my problem.
Any clues or suggestions? I suppose I could create the instance
I need programmatically, but that is painful; I would rather make
Interface Builder work if I can.
(Incidentally, I think I understand that there is an Xcode /
Interface Builder 3.2.3 available to folks in the iPhone developer
program -- which I am not in -- and I was thinking perhaps I should
steer clear of 4.0 until it gets past the "preview" stage...)
-- Jay Reynolds Freeman
---------------------
email@hidden
http://web.mac.com/jay_reynolds_freeman (personal web site)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden