• 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: Query: IBOutlet fails if setter method of same name exists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Query: IBOutlet fails if setter method of same name exists


  • Subject: Re: Query: IBOutlet fails if setter method of same name exists
  • From: "Erik J. Barzeski" <email@hidden>
  • Date: Mon, 13 May 2002 14:38:56 -0400

Hi,

On 5/13/02 1:38pm, Bill Cheeseman <email@hidden> wrote:
> Don't do that.
>
> It is an Objective-C (or at least Cocoa) convention that the "set" accessor
> for an instance variable is given the same name as the instance variable,
> substituting an initial cap for the first letter of the instance variable's
> name and adding the prefix "set" (lowercase "s"). The developer tools and
> Cocoa make use of this in a number of situations by looking for a set
> accessor that follows these naming conventions and using it if found. I
> believe this is all done in the key-value coding stuff.

To be perfectly honest, it also looks for the methods _foo and setFoo as
well, I believe.

However, Bill is right in that "foo" is the much 'preferred' name, the
standard, the whatever you want to call it. The others will work... But
maybe they won't in 10.2. They just work "for now...".

It should also be noted that if any methods aren't found, the code will just
pound the value into your iVar itself. You don't want that. You want control
over what goes into what.

--
Kindest regards,
Erik J. Barzeski

"It ain't braggin' if you can do it."
-- Dizzy Dean, 1930's baseball player
*******************************************************************
Email: erik@(anything below)
AIM: iacas ICQ: 8186546

http://barzeski.com/ http://weims.net/
http://techstra.net/ http://cocoadevcentral.com/
http://soundsetcentral.com/ http://applescriptcentral.com/
*******************************************************************
_______________________________________________
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: Query: IBOutlet fails if setter method of same name exists
      • From: Vince DeMarco <email@hidden>
  • Prev by Date: Re: DocumentController & ApplicationController: messages between them?
  • Next by Date: Re: referring to global windows
  • Previous by thread: Re: Query: IBOutlet fails if setter method of same name exists
  • Next by thread: Re: Query: IBOutlet fails if setter method of same name exists
  • Index(es):
    • Date
    • Thread