FROM : Steven Hamilton
DATE : Fri May 30 23:40:00 2008
Thanks everyone. Good answers all round.
On 31/05/2008, at 4:51 AM, mmalc crawford wrote:
>
> On May 30, 2008, at 3:09 AM, Peter Burtis wrote:
>
>> The compiler only knows about methods declared somewhere or the
>> headers, and Core Data accessor methods are handled at runtime and
>> not declared anywhere. It's only a warning and not an error
>> because the compiler is smart enough to know that Objective C can
>> do cool stuff like that.
>> One solution is to use [managedObject valueForKey:@"memo"] and
>> [managedObject setValue:@"test123" forKey:@"memo"] instead of the
>> accessors.
>>
> No, don't do this.
> If you don't want to define a custom managed object class, the
> correct solution is to add a category of NSManagedObject that
> defines the methods to keep the compiler happy.
> <http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW9
> >
> Substituting KVC methods just to suppress compiler warnings
> needlessly makes your application less efficient.
>
> mmalc
>
DATE : Fri May 30 23:40:00 2008
Thanks everyone. Good answers all round.
On 31/05/2008, at 4:51 AM, mmalc crawford wrote:
>
> On May 30, 2008, at 3:09 AM, Peter Burtis wrote:
>
>> The compiler only knows about methods declared somewhere or the
>> headers, and Core Data accessor methods are handled at runtime and
>> not declared anywhere. It's only a warning and not an error
>> because the compiler is smart enough to know that Objective C can
>> do cool stuff like that.
>> One solution is to use [managedObject valueForKey:@"memo"] and
>> [managedObject setValue:@"test123" forKey:@"memo"] instead of the
>> accessors.
>>
> No, don't do this.
> If you don't want to define a custom managed object class, the
> correct solution is to add a category of NSManagedObject that
> defines the methods to keep the compiler happy.
> <http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW9
> >
> Substituting KVC methods just to suppress compiler warnings
> needlessly makes your application less efficient.
>
> mmalc
>
| Related mails | Author | Date |
|---|---|---|
| Steven Hamilton | May 30, 11:17 | |
| Peter Burtis | May 30, 12:09 | |
| Kyle Sluder | May 30, 15:35 | |
| Fritz Anderson | May 30, 20:16 | |
| mmalc crawford | May 30, 20:51 | |
| Steven Hamilton | May 30, 23:40 | |
| Ben Trumbull | May 30, 23:49 | |
| Chris Hanson | May 31, 10:13 |






Cocoa mail archive

