How to recognize mutability?
How to recognize mutability?
- Subject: How to recognize mutability?
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Wed, 20 Feb 2013 15:10:00 +0700
I am trying to build my own version of NSKeyed(Un)Archiver.
But I do not know how to recognise mutability.
1. use isKindOfClass: [NSMutableString class]
disadvantage: all strings turn out to be mutable
2. use respondsToSelector: @selector(appendString:)
disadvantage: all strings turn out to be mutable
3. mutate the string (in a @try block) if exception, then immutable, else mutate the string back.
disadvantage: very inelegant and probably quite slow
4. use some undocumented (which?) method
disadvantage: might break with next OS release
5. anything else?
Gerriet.
P.S.
I want my own archiver for 2 reasons:
1. NSKeyedArchiver can store only certain strings
2. It creates files, which are 10 times bigger than my version (and 5 times bigger than NSArchiver)
_______________________________________________
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