• 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
Re: How to use bindings on a specific array element
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • 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>
References: 
 >How to use bindings on a specific array element (From: "Arthur C." <email@hidden>)

  • Prev by Date: Re: Best way to play a MP3?
  • Next by Date: Re: How to use bindings on a specific array element
  • Previous by thread: How to use bindings on a specific array element
  • Next by thread: Re: How to use bindings on a specific array element
  • Index(es):
    • Date
    • Thread