Re: Document based app problems
Re: Document based app problems
- Subject: Re: Document based app problems
- From: Shawn Erickson <email@hidden>
- Date: Sat, 3 Jan 2004 13:34:22 -0800
On Jan 3, 2004, at 12:47 PM, April Gendill wrote:
second Absolutely nothing I do allows me to access ANY NSTextfield. I
cannot retrieve data from them or set their values
I was just reminded about this... you may be hitting KVC depending on
what the names of your outlets, etc. are. Note this following email
from a while back...
On Nov 25, 2003, at 9:05 AM, Glenn Andreas wrote:
At 9:16 AM -0700 11/25/03, Lance Drake wrote:
The main class has an NSWindow* as well as an NS ProgressIndicator*
- both are listed as an IBOutlet
- the IB instances and connections have been made and register as
such in the Nib outlets panel of the AppController instance.
In the course of app execution, the NSWindow* in the class becomes
initialized
- the NSProgressIndicator* does not (it remains NULL).
What mechanism, not yet invoked, would cause the NSProgressIndicator*
to be able to accessed?
By any chance would that instance, say, be called:
IBOutlet NSProgressIndicator *progress;
and then you have a method:
- (void) setProgress: (int) percent;
(whose job is to update the progress indicator with a given value)?
If so, then you've just tripped over Key Value Coding, where by any
instance named "foo" that is set from a NIB (or explicitly via KVC
calls) will first attempt to call a routine "setFoo:" (and then, IIRC,
"foo:") rather than directly set the instance variable (which it would
do if that routine doesn't exist).
The solution is to change the name of the method to not be the KVC
"setter" method (or change the instance variable name).
_______________________________________________
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.