Re: Cocoa Target Remains NULL
Re: Cocoa Target Remains NULL
- Subject: Re: Cocoa Target Remains NULL
- From: Lance Drake <email@hidden>
- Date: Tue, 25 Nov 2003 14:45:03 -0700
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).
Hi Glenn,
Good golly! That was it! That insight was certainly not obvious to
me. What a stupid error. Y'd THINK... there'd be no such namespace
conflict - but, by simply changing the name of the function, the (hoped
for) initialization occurred and the problem was solved.
Thank you so very much for your helpful response. Thanks also to the
additional info and assist from Prachi Gauriar.
Best Wishes,
Lance Drake
_______________________________________________
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.