[Rubycocoa-devel 485] Re: nil assertion for conversion NSArray/NSDictionary

Zurück zum Archiv-Index

Laurent Sansonetti lsans****@apple*****
Sun Dec 10 03:52:27 JST 2006


Hi,

Actually, from http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNull_Class/Reference/Reference.html 
  :

"The NSNull class defines a singleton object used to represent null  
values in collection objects (which don’t allow nil values)."

So according to this comment it should be safe to use it in NSArray/ 
NSDictionary.  Also, it just inherits from NSObject, so it's a very  
basic class that shouldn't cause problems.

# I can ask investigate more if you want.

Laurent

On Dec 9, 2006, at 4:11 PM, kimura wataru wrote:

> Hi,
>
> There are no descriptions about NSNull value in class references
> of NSArray and NSMutableArray (except archiving). I suppose using
> NSNull into NSArray leads unexpected results.
>
> http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/Reference/Reference.html
> http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/Reference/Reference.html
>
> http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html
> http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSMutableDictionary_Class/Reference/Reference.html
>
>
> On Sat, 9 Dec 2006 13:43:11 +0100, Laurent Sansonetti wrote:
>> Hi Kimura-san,
>>
>> On Dec 9, 2006, at 11:54 AM, kimura wataru wrote:
>>
>>> Hi,
>>>
>>> RubyCocoa automatically converts Array->NSArray and Hash-
>>>> NSDictionary.
>>> But treatment of nil value is different between Ruby and Cocoa.
>>>
>
>>
>> Good catch!
>>
>> However, it looks like NSNull can also be used as NSArray value and
>> NSDictionary key. Why not always using NSNull?
>>
>
> -- 
> kimura wataru
> _______________________________________________
> Rubycocoa-devel mailing list
> Rubyc****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/rubycocoa-devel




More information about the Rubycocoa-devel mailing list
Zurück zum Archiv-Index