Re: Accessor method idioms...
Re: Accessor method idioms...
- Subject: Re: Accessor method idioms...
- From: Mike Ferris <email@hidden>
- Date: Fri, 25 Mar 2005 07:30:53 -0800
I've tried writing like this but it always starts to feel redundant,
an unnecessary layer of indirection. Maybe there are circumstances
where it's helpful but... I haven't found them.
[[self things] objectAtIndex: index]
Just seems way more transparent than:
objectInThingsAtIndex: index
at least when 'things' is a built-in type like NSArray, anyway.
Absolutely. That's why only the first three methods -things,
-setThings: and -mutableThings are public.
But, you need to implement at least some of the keyed accessors or the
performance behavior of mutableArrayValueForKey: will be ridiculous.
What I was trying to get at was a minimal public API that kept a
couple things true:
- There are accessors (the generic and untyped KVC methods do not
constitue a "good" "direct" API in my opinion)
- They perform reasonably well
Mike
_______________________________________________
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