• 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: Thomas Davie <email@hidden>
  • Date: Thu, 20 May 2010 15:40:12 +0100

On 20 May 2010, at 15:24, mmalc Crawford wrote:

>
> On May 19, 2010, at 4:38 am, Sherm Pendley wrote:
>
>> If you set the ivars directly, as above, the synthesized setters will
>> NOT be called. For that to happen, you need to use dot-syntax, like
>> this:
>>
>> - (void) dealloc {
>>   self.beginButton = nil;
>>   self.endButton = nil;
>>   // etc...
>>   [super dealloc];
>> }
>>
> You do not *need* to use the dot syntax to invoke the accessors synthesised for a property. You can also use the corresponding accessor method using [] syntax, e.g.
>
> 	[self setBeginButton:nil];
>
> However, you should typically not invoke accessor methods in init or dealloc methods.

Can I ask why you shouldn't use them in init?  It makes a lot of sense to not use them in alloc/dealloc, but I'm not using them in init... after all, what if I replace the ivar with a derived property from another object?  Why should I have to recode my init?

Bob_______________________________________________

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: Regarding MVC design pattern
      • From: mmalc Crawford <email@hidden>
    • Re: Regarding MVC design pattern
      • From: Kyle Sluder <email@hidden>
    • Re: Regarding MVC design pattern
      • From: Barry Skidmore <email@hidden>
References: 
 >Regarding MVC design pattern (From: Sai <email@hidden>)
 >Re: Regarding MVC design pattern (From: Henry McGilton <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: 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: mmalc Crawford <email@hidden>)

  • Prev by Date: Changing the view that's used for a print operation
  • Next by Date: Re: Regarding MVC design pattern
  • Previous by thread: Re: Regarding MVC design pattern
  • Next by thread: Re: Regarding MVC design pattern
  • Index(es):
    • Date
    • Thread