• 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: @property question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @property question


  • Subject: Re: @property question
  • From: Phoenix Draco <email@hidden>
  • Date: Mon, 12 May 2008 15:42:27 -0700
  • Thread-topic: @property question

Sorry if this is naïve but I have a quick follow up q (to verify that I am
understanding ObjC correctly). Is it true that:

The two styles seem to me to have slightly different execution paths. The
first:

[self.fieldArray addObject:inFoo]

Would actually invoke the property accessor fieldArray and then send the
message addObject: to the returned result, i.e. Its equivalent to:

[[self getfieldArray] addObject:inFoo]

While the second form [fieldArray addObject:inFoo] would directly use the
member variable.

So if you (for some reason) chose to have a more complicated accessor that
is not simply backed by an ivar, the former may have some potential side
effects, yes?

Thanks,
Phoenix


On 5/12/08 3:19 PM, "Craig Hopson" <email@hidden> hollered from the
keytops:

> Guys,
>
> I think I've been the victim of some side effect that I cannot track
> down. With no other changes, I tried again with each style,
> [ self.fieldArray addObject:inFoo ];
> [ fieldArray addObject:inFoo ];
> replacing all occurrences for each test, and both work - what I would
> have expected.
>
> Thanks for your input.
> -Craig
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> com
>
> This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: @property question
      • From: "Clark Cox" <email@hidden>
References: 
 >Re: @property question (From: Craig Hopson <email@hidden>)

  • Prev by Date: Re: adding a custom view to NSPrintPanel
  • Next by Date: Re: @property question
  • Previous by thread: Re: @property question
  • Next by thread: Re: @property question
  • Index(es):
    • Date
    • Thread