Class: NSMapTable
Overview
NSMapTable is a mutable collection modeled after NSDictionary but provides different options.
Class Method Summary (collapse)
-
+ mapTableWithKeyOptions:valueOptions:
Returns a new map table, initialized with the given options.
-
+ strongToStrongObjectsMapTable
Returns a new map table object which has strong references to the keys and values.
-
+ strongToWeakObjectsMapTable
Returns a new map table object which has strong references to the keys and weak references to the values.
-
+ weakToStrongObjectsMapTable
Returns a new map table object which has weak references to the keys and strong references to the values.
-
+ weakToWeakObjectsMapTable
Returns a new map table object which has weak references to the keys and values.
Instance Method Summary (collapse)
-
- count
Returns the number of key-value pairs in the map table.
-
- dictionaryRepresentation
Returns a dictionary representation of the map table.
-
- initWithKeyOptions:valueOptions:capacity:
Returns a map table, initialized with the given options.
-
- initWithKeyPointerFunctions:valuePointerFunctions:capacity:
Returns a map table, initialized with the given functions.
-
- keyEnumerator
Returns an enumerator object that lets you access each key in the map table.
-
- keyPointerFunctions
Returns the pointer functions the map table uses to manage keys.
-
- objectEnumerator
Returns an enumerator object that lets you access each value in the map table.
-
- objectForKey:
Returns a the value associated with a given key.
-
- removeAllObjects
Empties the map table of its entries.
-
- removeObjectForKey:
Removes a given key and its associated value from the map table.
-
- setObject:forKey:
Adds a given key-value pair to the map table.
-
- valuePointerFunctions
Returns the pointer functions the map table uses to manage values.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Class Method Details
+ (Object) mapTableWithKeyOptions(keyOptions, valueOptions:valueOptions)
Returns a new map table, initialized with the given options
+ (Object) strongToStrongObjectsMapTable
Returns a new map table object which has strong references to the keys and values.
+ (Object) strongToWeakObjectsMapTable
Returns a new map table object which has strong references to the keys and weak references to the values.
+ (Object) weakToStrongObjectsMapTable
Returns a new map table object which has weak references to the keys and strong references to the values.
+ (Object) weakToWeakObjectsMapTable
Returns a new map table object which has weak references to the keys and values.
Instance Method Details
- (Integer) count
Returns the number of key-value pairs in the map table.
- (Hash) dictionaryRepresentation
Returns a dictionary representation of the map table. The map table’s contents must be objects.
- (Object) initWithKeyOptions(keys, valueOptions:values, capacity:capacity)
Returns a map table, initialized with the given options. values must contain entries at all the indexes specified in keys.
- (Object) initWithKeyPointerFunctions(keyFunctions, valuePointerFunctions:valueFunctions, capacity:initialCapacity)
Returns a map table, initialized with the given functions.
- (NSEnumerator) keyEnumerator
Returns an enumerator object that lets you access each key in the map table. The following code fragment illustrates how you might use the method.
- (NSPointerFunctions) keyPointerFunctions
Returns the pointer functions the map table uses to manage keys.
- (NSEnumerator) objectEnumerator
Returns an enumerator object that lets you access each value in the map table. The following code fragment illustrates how you might use the method.
- (Object) objectForKey(aKey)
Returns a the value associated with a given key.
- (Object) removeAllObjects
Empties the map table of its entries.
- (Object) removeObjectForKey(aKey)
Removes a given key and its associated value from the map table. Does nothing if aKey does not exist.
- (Object) setObject(anObject, forKey:aKey)
Adds a given key-value pair to the map table.
- (NSPointerFunctions) valuePointerFunctions
Returns the pointer functions the map table uses to manage values.