Do I need private accessor methods?
Do I need private accessor methods?
- Subject: Do I need private accessor methods?
- From: "Eric Lin" <email@hidden>
- Date: Fri, 28 Apr 2006 14:32:00 -0700
Do I need to create private accessor methods for my private instance
variables? I'm asking this because the most correct constructure form seems
to require it:
if (self = [super init]) {
[self setPrivateVariable:123];
}
This wouldn't be correct in the case that [super init] returns a different
self:
if (self = [super init]) {
privateVariable = 123;
}
If I indeed have to do it the first way, how do I create private accessor
methods? And should I make it a rule of thumb to create accessor methods
for all private variables? (would seem like quite a chore though).
Thanks,
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden