>> 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
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
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.
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
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
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.
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
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