• 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: Determining if NS/CFDictionary is mutable?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining if NS/CFDictionary is mutable?


  • Subject: Re: Determining if NS/CFDictionary is mutable?
  • From: Ali Ozer <email@hidden>
  • Date: Mon, 23 Dec 2002 17:04:21 -0800

you can use this to tell whether the dictionary is mutable or not. However this function comes from CoreFoundation.framework and is not in headers. It works, but use it at your own risk:

extern Boolean _CFDictionaryIsMutable(CFDictionaryRef ref);

This function is private and likely to be removed or changed in a future release, please don't use it!

From an API point of view, there is no way to tell if something is mutable or not. If something is in your data structures, then you yourself can remember this; if this is something you get back from an API, then you should pay attention to whatever the API is returning. That is, if the API says it returns an immutable dictionary, treat it as immutable dictionary. Clever but sneaky optimizations that try to tell whether a returned dictionary is mutable or not are likely to fail under some circumstances. (For instance, the mutable item you get might be part of someone else's persistent data structure.)

Ali
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Determining if NS/CFDictionary is mutable? (From: Tomas Zahradnicky <email@hidden>)

  • Prev by Date: Implementing a status indicator (like iChat's)
  • Next by Date: Re: Determining if NS/CFDictionary is mutable?
  • Previous by thread: Re: Determining if NS/CFDictionary is mutable?
  • Next by thread: Re: Determining if NS/CFDictionary is mutable?
  • Index(es):
    • Date
    • Thread