• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to use bindings on a specific array element
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to use bindings on a specific array element
      • From: George Orthwein <email@hidden>
    • Re: How to use bindings on a specific array element
      • From: Francis Derive <email@hidden>
  • Prev by Date: Re: How is a bound NSArrayController so stealthy?
  • Next by Date: Cocoaheads Lake Forest (92630) meeting tonight, Tuesday 6/5
  • Previous by thread: Re: How is a bound NSArrayController so stealthy?
  • Next by thread: Re: How to use bindings on a specific array element
  • Index(es):
    • Date
    • Thread