Re: NSMutableDictionary or Custom Object when adding properties?
Re: NSMutableDictionary or Custom Object when adding properties?
- Subject: Re: NSMutableDictionary or Custom Object when adding properties?
- From: Graham Cox <email@hidden>
- Date: Fri, 17 May 2013 16:41:13 +1000
On 17/05/2013, at 3:43 PM, Trygve Inda <email@hidden> wrote:
> But for the objects I don't see a nice way to do this
>
> There is setValue:forUndefinedKey: and then each object could keep a local
> dictionary of these "defined at runtime" keys.
There are low-level runtime methods that allow you to add properties at runtime. I'm not sure whether that's considered good practice, but it's doable.
Otherwise your approach seems fine.
--Graham
_______________________________________________
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