Re: Memory management question
Re: Memory management question
- Subject: Re: Memory management question
- From: Jerry Krinock <email@hidden>
- Date: Sat, 27 Mar 2004 10:00:34 -0800
I know this thread has been dead for a few days, but it took me that long to
study it and all the referenced articles.
I have a question regarding the use of accessor methods for "object instance
variables", (which I prefer to call "objects within objects").
I understand the recommendation to use fancy setter methods, with their
pattern of retain, release, copy; and I also understand the arguments for
and against using autorelease there instead of release.
But I don't understand the recommendation to use the getter method:
- (NSSomeType*)foo
{
return foo;
}
and the advice to always use the getter method
[self foo]
instead of just a direct reference
foo
when using foo in other methods in the class.
What's the effective difference between these two expressions? All I can
see is that the getter has the overhead of a message, while the direct
reference does not and should run faster.
Jerry Krinock
_______________________________________________
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.