• 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: Binding to a specific element in an array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding to a specific element in an array


  • Subject: Re: Binding to a specific element in an array
  • From: "I. Savant" <email@hidden>
  • Date: Sun, 4 Feb 2007 13:14:51 -0500


Why not add a transient property to your FileCollection entity called "firstAvailablePath" or something similar that finds the path of the first "FileInstance" in your "instances" relationship?


Note also that the order in which the instances (as in object instances of "FileInstance") are fetched is not guaranteed, so you'll need to add some kind of sorting to make sure you're getting the instance you actually want.

--
I.S.


On Feb 4, 2007, at 12:12 PM, Stuart Rogers wrote:

I'm working on a Core Data application for handling identical files.

I have an entity called FileCollection which contains a to-many
relationship called instances which relates to some instances of
my FileInstance entity.  The FileInstance entity contains, amongst
other things, a string attribute called path.

My interface contains a table which lists the FileCollection items
(arrangedObjects of my FileCollection Array Controller).  I want
to bind one of the table columns such that it displays the path of
the first FileInstance listed in the FileCollection's instances.

What I'm after, in effect, is a model key path of "instances[0].path"
(i.e. the path attribute of the first object in the instances array).
I realize this isn't the way to do it, so how do I access a specific
item in an array using bindings in Interface Builder?

Stuart
_______________________________________________

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:
40gmail.com


This email sent to email@hidden

_______________________________________________

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: Binding to a specific element in an array
      • From: Stuart Rogers <email@hidden>
References: 
 >Binding to a specific element in an array (From: Stuart Rogers <email@hidden>)

  • Prev by Date: Strange window controller behaviour with "move focus to next window..."
  • Next by Date: Re: Strange window controller behaviour with "move focus to next window..."
  • Previous by thread: Binding to a specific element in an array
  • Next by thread: Re: Binding to a specific element in an array
  • Index(es):
    • Date
    • Thread