>> I would think 'copy' would still be ok with this (for example in the case of
>> NSStrings) since that should still be released. For 'assign' I can see the
>> advantage.
> 
> It’s not just an advantage, it’s avoiding a crasher, most likely, and where
> it’s not, it’s avoiding silently corrupting an object graph. [(id)someInt
> release] is not a message you want to ever find yourself sending.
> 
>> So this would be better?
>> 
>> for (NSString* key in [self propertyKeys])
>> [self setValue:nil forKey:key];
> 
> 
> No, because unless you also override -setNilValueForKey: for your classes that
> do this, you will raise an NSInvalidArgumentException.


None of my properties are ints, doubles, longs or any other non-object type.
This class is really a replacement for just using an NSMutableDictionary to
store this stuff. All the properties are NSNumber, NSString or NSColor

Trygve




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to