Re: How to use bindings on a specific array element
Re: How to use bindings on a specific array element
- Subject: Re: How to use bindings on a specific array element
- From: Francis Derive <email@hidden>
- Date: Wed, 6 Jun 2007 11:27:36 +0200
Arthur,
I may not be the guru you are expecting, but - in case my
clarification needs may help :
You have - say - 10 custom views in your interface, and so - by now -
your nib is cluttered with one NSObjectController for each of the
view = that is 10 NSWindowControllers. Right ?
If so, because I have a similar (problematic) situation, I only but
can tell about the "Indexed Accessor Patterns for To-Many Properties"
at page 18 of the ADC document "Key-Value Coding Programming Guide" -
but couldn't yet understand how to make it - if ever possible along
this way.
Hope you could make it - and tell me about it.
Francis.
On Jun 5, 2007, at 11:18 PM, Arthur C. wrote:
This must be a basic bindings question, but I haven't solved it in
a convenient way so far.
When I have say 10 custom views in my window, I get 10 items in my
NIB file. Each of the views has to be bound to one instance of some
class which delivers the data/image to be shown. What I have done
so far is instantiate the class 10 times in the NIB, and then
create the bindings. But this makes my interface file quite large
and messy (what if I decide to have 50 of them?)... I wonder if
it's possible to create an array programmatically, something like
[myArray addObject: [[myClass alloc] init]];
and have each of the custom views bound to array element 0, 1,
2, ... respectively. This cleans up the NIB file and makes it a lot
easier to access all the myClass instances.
But maybe there is another way to accomplish something like this?
Well, thanks for your help,
Arthur C.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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