Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Christian Ziegler
Hi all! I would like to step in here for a related question. Is there any way to get rid of the compiler warnings if you use the generated accessors without writing a subclass of NSManagedObject and adding properties and method declarations? Regards, Chris

Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Mike Abdullah
On 23 Apr 2010, at 10:46, Christian Ziegler wrote: Hi all! I would like to step in here for a related question. Is there any way to get rid of the compiler warnings if you use the generated accessors without writing a subclass of NSManagedObject and adding properties and method

Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Roland King
yes there is - and it's in the documentation too http://developer.apple.com/mac/library/documentation/cocoa/conceptual/CoreData/Articles/cdAccessorMethods.html If you are not using a custom class, to suppress compiler warnings you can declare the properties in a category of NSManagedObject:

Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Joanna Carter
Hi Christian I would like to step in here for a related question. Is there any way to get rid of the compiler warnings if you use the generated accessors without writing a subclass of NSManagedObject and adding properties and method declarations? Normally, generating a subclass also

Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Mike Abdullah
ah, good point. Seems pretty ugly though as you start suggesting that all managed objects support those methods. It only takes a moment to generate a subclass that does this. On 23 Apr 2010, at 11:28, Roland King wrote: yes there is - and it's in the documentation too

Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Christian Ziegler
Hi all! First of all shame on me, I didn't read this article entirely (one of my very very bad traits ;-) ), thanks very much though for pointing it out. Given the very good arguments I think it's better to create subclasses. Also thanks to Mike I figured out how to easily create those

Re: setValue:forKey: and to-many relationships

2010-04-23 Thread Dave DeLong
Aha! I overlooked that one because I was expecting the method to accept two parameters. Thanks! :) Dave Sent from my iPhone On Apr 22, 2010, at 2:39 PM, Keary Suska cocoa-...@esoteritech.com wrote: -mutableSetValueForKey: ___ Cocoa-dev mailing

setValue:forKey: and to-many relationships

2010-04-22 Thread Dave DeLong
Hi everyone, I'm working with some NSManagedObjects and relationships between them. When my code runs, I generate the appropriate key based on the data that I'm parsing. For non-relationship attributes, I can simply do: [myManagedObject setValue:aValue forKey:key]; My question is about

Re: setValue:forKey: and to-many relationships

2010-04-22 Thread Keary Suska
On Apr 22, 2010, at 2:28 PM, Dave DeLong wrote: I'm working with some NSManagedObjects and relationships between them. When my code runs, I generate the appropriate key based on the data that I'm parsing. For non-relationship attributes, I can simply do: [myManagedObject setValue:aValue