• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa Target Remains NULL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Cocoa Target Remains NULL (From: Glenn Andreas <email@hidden>)

  • Prev by Date: Re: ZeroLink and dynamic discovered Classes
  • Next by Date: RE: Opening a sheet in a non document project?
  • Previous by thread: Re: Cocoa Target Remains NULL
  • Next by thread: Communication between an NSView and AppController;
  • Index(es):
    • Date
    • Thread