Re: Accessor method article preview
Re: Accessor method article preview
- Subject: Re: Accessor method article preview
- From: Edwin Zacharias <email@hidden>
- Date: Wed, 12 Jun 2002 23:41:07 -0400
Thanks very much for the accolades, mmalc. Here's one quick tip that is
probably beyond the scope of your article as it will just make things
more complicated for new programmers.
All my setters look like this:
- (void)setName: (NSString *)name
{
SCSetObject( __name, name );
}
Nice and simple. Here's the define:
#define SCSetObject(oldObject, newObject) [ newObject retain ],
[ oldObject release], oldObject = newObject;
I'm now able to make changes to all my setters system wide based on the
stuff I learned in your article. I should have also created an
SCGetObject define to use for getter methods, but I didn't think that
far ahead.
- Edwin
On Wednesday, June 12, 2002, at 03:46 PM, mmalcolm crawford wrote:
On Tuesday, June 11, 2002, at 05:31 PM, I wrote:
For anyone who's interested, I've put a preview of a forthcoming
Stepwise article on Accessor methods at:
http://homepage.mac.com/mmalc/Stepwise/accessorMethods2.html
Many thanks to all those who have already given feedback. A number of
errors have been corrected.
I hesitate to single any one person out, but Edwin Zacharias has been
particularly helpful with respect to multi-threaded issues, and has
exposed what was a misconception for me, and I suspect some others.
I have as a result somewhat reorganised the article, and included a
couple more examples. These may, or may not, make things more clear...
In particular I have created a separate section on multi-threading
issues, since these are likely to be a consideration for a subset of
readers (and something newcomers probably don't want to wade through on
a first, or even second, pass).
Since questions related to accessor methods arise with some frequency,
I would very much appreciate any comments anyone else has to make so
that, as a community, we can try to make this article into a reference
that all can turn to in the future rather than having to rewrite the
same answer time after time.
I will continue to update the article over the next couple of days (at
least!) and post again when I think it's about ready.
mmalc
(To possibly save time for some: I won't necessarily be spell-checking
the article as it's updated, so please don't let me know about typos
unless they're in code.)
_______________________________________________
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.
_______________________________________________
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.