Re: Send msg to object by nameed NSString;
Re: Send msg to object by nameed NSString;
- Subject: Re: Send msg to object by nameed NSString;
- From: Trygve Inda <email@hidden>
- Date: Fri, 20 Jun 2014 07:28:47 -0700
- Thread-topic: Send msg to object by nameed NSString;
>> 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 (email@hidden)
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:
This email sent to email@hidden