• 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: Glenn Andreas <email@hidden>
  • Date: Tue, 25 Nov 2003 11:05:43 -0600

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).


--
Glenn Andreas email@hidden Theldrow, Blobbo, Cythera, oh my!
Be good, and you will be lonesome
_______________________________________________
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.
  • Follow-Ups:
    • Re: Cocoa Target Remains NULL
      • From: Lance Drake <email@hidden>
References: 
 >Cocoa Target Remains NULL (From: Lance Drake <email@hidden>)

  • Prev by Date: Formatter Icon
  • Next by Date: Re: Communication between an NSView and AppController;
  • Previous by thread: Cocoa Target Remains NULL
  • Next by thread: Re: Cocoa Target Remains NULL
  • Index(es):
    • Date
    • Thread