• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Send msg to object by nameed NSString;
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Send msg to object by nameed NSString; (From: Daniel DeCovnick <email@hidden>)

  • Prev by Date: Re: Send msg to object by nameed NSString;
  • Next by Date: Re: NSReleasePool issue
  • Previous by thread: Re: Send msg to object by nameed NSString;
  • Next by thread: supportedInterfaceOrientations in Swift
  • Index(es):
    • Date
    • Thread