• 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
How to recognize mutability?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to recognize mutability?
      • From: Jens Alfke <email@hidden>
    • Re: How to recognize mutability?
      • From: Markus Spoettl <email@hidden>
    • Re: How to recognize mutability?
      • From: Ronald Oussoren <email@hidden>
  • Prev by Date: Re: dragging NSTableColumn to another table
  • Next by Date: Re: How to recognize mutability?
  • Previous by thread: Re: NSScrollView: should I use autolayout or not?
  • Next by thread: Re: How to recognize mutability?
  • Index(es):
    • Date
    • Thread