Creating a 'complex' ArrayController based view.
Creating a 'complex' ArrayController based view.
- Subject: Creating a 'complex' ArrayController based view.
- From: Brian Bruinewoud <email@hidden>
- Date: Wed, 24 Jun 2009 21:26:54 +1000
All,
I'm ok with creating a special view for a simple value - that is, a
single item.
I'm not sure what the best way is to design a view that displays items
from an array.
For the single item view, the view is based on three values that are
bound to the view. (eg: width, height, colour)
For the complex collection view, the view is based on these 'single
views' (one per item in the array) but there are additional values
taken from the array to indicate other properties. (eg: x-coord, y-
coord).
If I were just writing the single item view I wouldn't care so much
and I'd just write the view simply overriding the drawRect and getting
the values from the source controller directly.
However, the collection view complicates things- firstly, the single
view version is now required to be reusable in both the single and
collection views.
So, my questions are:
Should I write a shared function, object or Cell that draws the view
and is used by both the single and collection views? Or something else?
Should I iterate the array controller in the collection view's
drawRect or should I observer the controller or its array or
something? (in the application the array is VERY unlikely to have 100
items, even 20 is probably would be unusual)
Thanks,
Brian.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden