• 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: Regarding MVC design pattern
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regarding MVC design pattern


  • Subject: Re: Regarding MVC design pattern
  • From: Kyle Sluder <email@hidden>
  • Date: Thu, 20 May 2010 06:41:57 -0700

On Thu, May 20, 2010 at 5:44 AM, Joanna Carter
<email@hidden> wrote:
> Le 20 mai 2010 à 13:24, Alexander Spohr a écrit :
> Yes, because the ivar is synthesised, addressing myFoo would send the release message to the property, which is not recommended.

No. "Send the release message to the property" is a meaningless
phrase. Only objects can receive release messages, and the property
accessor returns the same address that is stored in the ivar, so the
same object would receive the -release message. Also, property
accessors are only called with either dot or method syntax; plain old
`myFoo = bar` will not call -setFoo:.

> Apparently, self->myFoo is capable of reaching the synthesised ivar.

Alexander is correct that plain old `myFoo` will also access the
synthesized ivar. There used to be a GCC bug in which synthesized
ivars were inaccessible (at least through self-> syntax; now I can't
recall whether they were wholly inaccessible). That, combined with the
fact that there is no declaration of the ivar in scope, has led me to
always use self-> syntax. I can't even recall seeing it documented
that @synthesize myFoo; puts the myFoo symbol in scope; if it has ever
been documented, I can't find it now.

--Kyle Sluder
_______________________________________________

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

References: 
 >Regarding MVC design pattern (From: Sai <email@hidden>)
 >Re: Regarding MVC design pattern (From: Sai <email@hidden>)
 >Re: Regarding MVC design pattern (From: Kyle Sluder <email@hidden>)
 >Re: Regarding MVC design pattern (From: Sai <email@hidden>)
 >Re: Regarding MVC design pattern (From: Jack Nutting <email@hidden>)
 >Re: Regarding MVC design pattern (From: Joanna Carter <email@hidden>)
 >Re: Regarding MVC design pattern (From: Sherm Pendley <email@hidden>)
 >Re: Regarding MVC design pattern (From: Kyle Sluder <email@hidden>)
 >Re: Regarding MVC design pattern (From: Alexander Spohr <email@hidden>)
 >Re: Regarding MVC design pattern (From: Joanna Carter <email@hidden>)

  • Prev by Date: Re: NSData from CGPDFPageRef
  • Next by Date: [iPhone] How to scale a UITextView Properly with typing text shown
  • Previous by thread: Re: Regarding MVC design pattern
  • Next by thread: Re: Regarding MVC design pattern
  • Index(es):
    • Date
    • Thread