Re: A Challenge WAS Accessor method idioms...
Re: A Challenge WAS Accessor method idioms...
- Subject: Re: A Challenge WAS Accessor method idioms...
- From: Nicko van Someren <email@hidden>
- Date: Thu, 24 Mar 2005 20:32:45 +0000
On 24 Mar 2005, at 19:11, John Brownlow wrote:
I'm a HUGE fan of Accessorizer but here is 50+ lines for a single
array. Let's say I have ten arrays, not at all unlikely... now it's
500 lines of mechanical code that I haven't ever read. Yuk. And I am
completely reliant on the genius of Accessorizer because believe me I
am NOT going to type those 500 lines myself and neither is anyone
else.
Perhaps the answer to this problem is to write the core, generic
functionality of Accessorizer as a category for NSObject and implement
methodForSelector: and respondsToSelector: with a table-driven system
that lets you specify the desired mode of access settings for each
instance variable. The generic accessor function can tell which
instance variable you care about by looking at the selector passed in
the hidden argument _cmd and the class initialisation code could set up
some simple hash tables on startup to make sure that the lookup is
fast.
Nicko
_______________________________________________
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