Re: Determining if NS/CFDictionary is mutable?
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.