Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-03-01 Thread Ben Trumbull
>> NSManagedObject* obj; // gets created somehow >> >> [obj setValue: nil forKey: @"bar"]; // succeeds where NSDictionary fails >> [obj setValue: [NSNull null] forKey: @"bar"]; // fails where NSDictionary >> succeeds >> >> so - this is conceptually buggy thinking and the thoughtful developer co

Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-03-01 Thread Quincey Morris
On Mar 1, 2010, at 00:12, Eagle Offshore wrote: > But in general, KVC requires object wrappers for things you can't put into > containers. In general (that is, in generic methods like valueForKey: and setValue:forKey:), KVC requires object pointers for values. It has nothing to do with contain

Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-03-01 Thread Eagle Offshore
Reconcile that with integers and I might buy it. But in general, KVC requires object wrappers for things you can't put into containers. NSNull should result in nil when used KVC calls just like NSNumber results in an integer. On Feb 28, 2010, at 11:53 PM, Alexander Spohr wrote: > > Am 01.03.

Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-03-01 Thread Quincey Morris
On Feb 28, 2010, at 23:12, Eagle Offshore wrote: > Documentation? "NSNull" does not appear in the documentation. > http://developer.apple.com/mac/library/documentation/cocoa/reference/CoreDataFramework/Classes/NSManagedObject_Class/Reference/NSManagedObject.html > > NSNull is conceptually the wr

Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-02-28 Thread Alexander Spohr
Am 01.03.2010 um 08:12 schrieb Eagle Offshore: > NSManagedObject* obj; // gets created somehow > > [obj setValue: nil forKey: @"bar"]; // succeeds where NSDictionary fails > [obj setValue: [NSNull null] forKey: @"bar"]; // fails where NSDictionary > succeeds > > so - this is conceptually buggy

Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-02-28 Thread Eagle Offshore
Documentation? "NSNull" does not appear in the documentation. http://developer.apple.com/mac/library/documentation/cocoa/reference/CoreDataFramework/Classes/NSManagedObject_Class/Reference/NSManagedObject.html NSNull is conceptually the wrapper for nil, like NSNumber is the wrapper for a number.

Re: NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-02-28 Thread Kyle Sluder
On Sun, Feb 28, 2010 at 6:16 PM, Eagle Offshore wrote: > Really?  This is a problem somehow? Yes. You can either provide an object or nil. You gave it an object it didn't like. > NSManagedObject couldn't just take the hint and go with nil? Would you rather an API based on "taking hints" or an A

NSNull vs nil in NSManagedObject setValue: v forKey: k

2010-02-28 Thread Eagle Offshore
Unacceptable type of value for attribute: property = "notes"; desired type = NSString; given type = NSNull; value = Really? This is a problem somehow? NSManagedObject couldn't just take the hint and go with nil? -Todd Blanchard ___ Cocoa-dev mai