non reference-counting dictionary in objective-c -


Is there a simple way of pure purpose-containers, such as NSMutableDictionary or CFMutableDictionary, which does not increase C ++ Reference count of added items without using standard library?

Edit: Explanation - The reason I want it to be that I can implement a type of "absolutely one" pattern - a stable GetThing in a class: (NSString *) name method if that method In some static data structures (non-reference-counting dictionary), there is something related to the name, then it takes it back, otherwise it makes one, it adds to the structure under that name, and returns it that item To customer It can be maintained as per wishes, but when its reference is counted on 0 (and called Delok), then it should be removed from the dictionary. Thus, when I delete it while adding it, then it is released Can not do- Delok will be called again, and I do not want that. This is the reason why I need a non-incremental dictionary if there is another way to get what I want, please let me know, though I am pretty sure the checked answer tells me what I want. Thanks!

If you are developing for MacOSX, you can use it. To find out more about it, refer to it.

If you are developing for the iPhone, you can use it with custom callback formations:

  • kCFTypeDictionaryKeyCallBacks and KCFTypeDictionaryValueCallBacks in the new Structures.
  • Keep the retention and release fields on the tap where you do not have pass the textures while calling CFDictionaryCreateMutable /

In this way, you are a dictionary that neither maintains or releases.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -