Re: Lost IBOutlet.
Re: Lost IBOutlet.
- Subject: Re: Lost IBOutlet.
- From: Vince DeMarco <email@hidden>
- Date: Thu, 8 Apr 2004 09:18:01 -0700
On Apr 6, 2004, at 1:16 PM, Hiro Fujimoto wrote:
Thanks, Fritz.
Exactly I defined a method named 'setStringValue:.
Read your advice, I place NSLog in it and detect it made the TextField
nil
before awakeFromNib. I solved my problem by renaming it but was this
documented somewhere ?
Yes right here in the IB FAQ
How are outlets connected at runtime?
The runtime code will use the list of outlets you generated in IB at
design time. For example, if you had specified an outlet called foo, IB
will first investigate the target class to see if it responds to
setFoo:(id). If it does, that method is called with the contents for
foo. If setFoo:(id) doesn't exist, the instance variable foo itself is
filled with the contents for foo.
In the IB main menu Help->FAQ-> change popup to Cocoa specific.
vince
--
On 2004/04/07, at 2:07, Fritz Anderson wrote:
One possibility -- Do you by chance have a method named
"setTextField:"? The protocol for nib loading, when such setX: methods
are present, is to use them instead of setting the member variables
directly. If the setter method does not in fact set the variable, the
variable remains set to nil.
-- F
On 5 Apr 2004, at 6:32 PM, Hiro Fujimoto wrote:
I got a mysterious problem in my project. I made a controller object
on
interface-
builder and generate its source skeleton. It has some NSTextField
outlets on dialog.
But Icouldn't set a string value on it, so I write following code.
- (void) awakeFromNib {
NSLog(@"the textfield is x", textField);
}
This code output 'the textfield is 00000000' !!
Did I lose the outlet before awakeFromNib ? How ? Why ?
--
Fritz Anderson
Consulting Programmer
http://resume.manoverboard.org/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
-----------------------------------------------------------------------
-
---------
hiro FUJIMOTO - developer in Japan.
[demime 0.98b removed an attachment of type
application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.