Re: bindings keypaths and collections

2012-07-29 Thread Quincey Morris
On Jul 29, 2012, at 11:15 , William Squires wrote: > Ex: my GameEngine class has an @property (nonatomic, strong) Player *player; > > The Player class, in turn, has an @property (nonatomic, strong) > NSMutableArray *inventory; > > and the following method > > -(void)addThing:(Thing *)theThing

bindings keypaths and collections

2012-07-29 Thread William Squires
If a class declares an @property that's a reference to one of the collection classes (or a mutable variant thereof), such as NSArray, NSDictionary, NSSet, etc… can a key path (for bindings) refer to on object in that collection? If so, what's the syntax? Ex: my GameEngine class has an @property

Re: Can keypaths contain array indexes?

2011-07-21 Thread Kyle Sluder
On Thu, Jul 21, 2011 at 12:08 PM, Jens Alfke wrote: > I’ve got a data model that looks sort of like this (expressed as JSON): >        [{“uuid": “abcdef”, “name": [“Fred”, “Smith”]} … ] > I want to bind an array of these to an NSTableView, with the first and last > name in different columns. So I

Can keypaths contain array indexes?

2011-07-21 Thread Jens Alfke
I’ve got a data model that looks sort of like this (expressed as JSON): [{“uuid": “abcdef”, “name": [“Fred”, “Smith”]} … ] I want to bind an array of these to an NSTableView, with the first and last name in different columns. So I need to create a keypath that refers to the first or secon

Core Data: fetching keypaths through abstract entities

2008-10-19 Thread David Riggle
I want to use a keypath that goes through an abstract entity down into a concrete sub-entity. For example, given this data model: Abstract entity: person Concrete sub-entities: man, woman Abstract entity: club relationship: members (->> person) Concrete sub-entities: allMale, coed I want to

Re: Keypaths

2008-07-16 Thread Niklas Saers
Hi Scott & Kyle: On Jul 16, 2008, at 2:22 AM, Scott Anguish wrote: In fact, as long as you have modeled relationships from parent to child you can do it, Core Data or not. Get a reference to Balbo and Ponto and then use a keypath involving @distinctUnionOfArrays to get to it. A bit of set theo

Re: Keypaths

2008-07-15 Thread Scott Anguish
On 15-Jul-08, at 4:08 PM, Kyle Sluder wrote: On Tue, Jul 15, 2008 at 8:41 AM, Hamish Allan <[EMAIL PROTECTED]> wrote: If you were using Core Data, expressing your familial relations as to-many relationships with inverses, it would be straightforward to achieve the query you want (and indeed,

Re: Keypaths

2008-07-15 Thread Kyle Sluder
On Tue, Jul 15, 2008 at 8:41 AM, Hamish Allan <[EMAIL PROTECTED]> wrote: > If you were using Core Data, expressing your familial relations as > to-many relationships with inverses, it would be straightforward to > achieve the query you want (and indeed, to create a GUI for that > query). In fact,

Re: Keypaths

2008-07-15 Thread Hamish Allan
des that have a grand-father > named Balbo Baggins and father named Ponto Baggins" (should be Rosa and Polo > Baggins) How do I express this with keypaths? I don't believe you can. Keypaths can contain certain expressions such as @max or @sum but not arbitrary relations. If you were

Keypaths

2008-07-15 Thread Niklas Saers
osa and Polo Baggins) How do I express this with keypaths? How should I make a keypath that returns an array of Nodes and another keypath that creates an array of NSStrings with only the name properties of the nodes? Cheers Nik ___ Co

Re: KVO Bug With Keypaths

2008-07-02 Thread Keary Suska
7/2/08 5:42 AM, also sprach [EMAIL PROTECTED]: >> When I modify their contents, they are modified using setObject:forKey:, > > -setValue:forKey: is the KVO-compliant mutator. I tested this--also see Ken Thomases recent post. NSMutableDictionary *does* emit KVO notifications for setObject:forKey:

Re: KVO Bug With Keypaths

2008-07-02 Thread Kyle Sluder
On Tue, Jul 1, 2008 at 6:18 PM, Keary Suska <[EMAIL PROTECTED]> wrote: > When I modify their contents, they are modified using setObject:forKey:, -setValue:forKey: is the KVO-compliant mutator. --Kyle Sludert ___ Cocoa-dev mailing list (Cocoa-dev@lists

Re: KVO Bug With Keypaths

2008-07-01 Thread Keary Suska
7/1/08 5:13 PM, also sprach [EMAIL PROTECTED]: > So to clarify: "related" is a dictionary that always contains a key > called "content", the object for which is a dictionary that always > contains a key called "status", the object for which is always > KVO-compliant for "value"? "relations" (the

Re: KVO Bug With Keypaths

2008-07-01 Thread Hamish Allan
On Tue, Jul 1, 2008 at 11:18 PM, Keary Suska <[EMAIL PROTECTED]> wrote: > When I modify their contents, they are modified using setObject:forKey:, > which I issues KVO notifications, IIRC. At least I know it does in certain > situations, as rely on that behavior in a number of places. > > I also m

Re: KVO Bug With Keypaths

2008-07-01 Thread Keary Suska
7/1/08 3:57 PM, also sprach [EMAIL PROTECTED]: > On Tue, Jul 1, 2008 at 5:26 PM, Keary Suska <[EMAIL PROTECTED]> wrote: >> I think so. "relations" and "content" are read-only (no public setters). >> Notifications aren't sent for them as they are never changed throughout the >> lifecycle of an obje

Re: KVO Bug With Keypaths

2008-07-01 Thread Kyle Sluder
On Tue, Jul 1, 2008 at 5:26 PM, Keary Suska <[EMAIL PROTECTED]> wrote: > I think so. "relations" and "content" are read-only (no public setters). > Notifications aren't sent for them as they are never changed throughout the > lifecycle of an object. I.e., they are both dictionaries, and only their

Re: KVO Bug With Keypaths

2008-07-01 Thread Keary Suska
7/1/08 3:01 PM, also sprach [EMAIL PROTECTED]: > On Tue, Jul 1, 2008 at 9:50 PM, Keary Suska <[EMAIL PROTECTED]> wrote: > >> I thought I saw somewhere a bug in KVO where notifications aren't properly >> sent in certain situations when "upper" parts of the path are updated. E.g., >> I have a situa

Re: KVO Bug With Keypaths

2008-07-01 Thread Hamish Allan
On Tue, Jul 1, 2008 at 9:50 PM, Keary Suska <[EMAIL PROTECTED]> wrote: > I thought I saw somewhere a bug in KVO where notifications aren't properly > sent in certain situations when "upper" parts of the path are updated. E.g., > I have a situation where is am observing a keypath > "relations.relat

KVO Bug With Keypaths

2008-07-01 Thread Keary Suska
I thought I saw somewhere a bug in KVO where notifications aren't properly sent in certain situations when "upper" parts of the path are updated. E.g., I have a situation where is am observing a keypath "relations.related.content.status.value" but notifications aren't sent when "related" is changed