How to use bindings on a specific array element
How to use bindings on a specific array element
- Subject: How to use bindings on a specific array element
- From: "Arthur C." <email@hidden>
- Date: Tue, 05 Jun 2007 23:18:22 +0200
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.
_________________________________________________________________
FREE pop-up blocking with the new Windows Live Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
_______________________________________________
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