Dictionary class.
More...
#import <SCDictionary.h>
Dictionary class.
- SDK
- macOS 10.6+, iOS 7.0+, GNUstep
- Since
- version 1.1.3
Implements the collection which uses the keys for access to the objects. Class also supports the data trees.
Class instances can thrown the following exceptions:
Returns a new array containing the keys corresponding to all occurrences of a given object in the dictionary.
- Parameters
-
object | - the object to look for in the dictionary |
- Returns
- A new array containing the keys corresponding to all occurrences of the specified object in the dictionary
Returns a boolean value that indicates whether an objects for all keys from the specified collection of any supported type are present in the receiving dictionary.
- Parameters
-
keys | - the collection with keys |
- Returns
- YES if all objects are present in the dictionary, otherwise NO
Returns a boolean value that indicates whether an object for at least one key from the specified collection of any supported type is present in the receiving dictionary.
- Parameters
-
keys | - the collection with keys |
- Returns
- YES if at least one object is present in the dictionary, otherwise NO
- (BOOL) containsNumberForKey: |
|
(NSString *) |
key |
|
Returns a boolean value that indicates whether a number for the given key is present in the receiving dictionary.
- Parameters
-
key | - the key for the desired number |
- Returns
- YES if a number for the given key is present in the dictionary, otherwise NO
- (BOOL) containsObjectForKey: |
|
(NSString *) |
key |
|
Returns a boolean value that indicates whether an object for the given key is present in the receiving dictionary.
- Parameters
-
key | - the key for the desired object |
- Returns
- YES if an object for the given key is present in the dictionary, otherwise NO
- (BOOL) containsStringForKey: |
|
(NSString *) |
key |
|
Returns a boolean value that indicates whether a string for the given key is present in the receiving dictionary.
- Parameters
-
key | - the key for the desired string |
- Returns
- YES if a string for the given key is present in the dictionary, otherwise NO
+ (instancetype) dictionary |
|
|
|
Creates and returns an unnamed empty dictionary.
- Returns
- A created dictionary
Reimplemented from SCCollection.
+ (instancetype) dictionaryWithCoder: |
|
(NSCoder *) |
coder |
|
Returns a dictionary created by using the specified coder.
- Parameters
-
- Returns
- A created dictionary
+ (instancetype) dictionaryWithCollection: |
|
(id<SCCollection>) |
collection |
|
Returns a dictionary created by using the objects from the specified collection of any supported type.
- Parameters
-
collection | - the existing source collection |
- Returns
- A created dictionary
- Exceptions
-
+ (instancetype) dictionaryWithContentsOfSerializedFile: |
|
(NSString *) |
path |
|
Returns a dictionary created by using the content of the serialized file with the specified path.
- Parameters
-
path | - the path to the source serialized file |
- Returns
- A created dictionary
+ (instancetype) dictionaryWithDataDictionary: |
|
(NSDictionary *) |
dictionary |
|
Returns a dictionary created by using the specified data dictionary.
- Parameters
-
dictionary | - the source data dictionary |
- Returns
- A created dictionary
+ (instancetype) dictionaryWithDataDictionaryFromFile: |
|
(NSString *) |
path |
|
Returns a dictionary created by using the data dictionary from the specified file.
- Parameters
-
path | - the path to the source data dictionary file |
- Returns
- A created dictionary
+ (instancetype) dictionaryWithDictionary: |
|
(SCDictionary *) |
dictionary |
|
Creates and returns a dictionary containing keys and objects from another given dictionary.
- Parameters
-
dictionary | - a dictionary containing the keys and values with which to initialize the new dictionary |
- Returns
- A new dictionary containing the keys and values found in the specified dictionary
- Exceptions
-
+ (instancetype) dictionaryWithFileStream: |
|
(NSString *) |
path |
|
Returns a dictionary created by using the data from the file stream with the specified path.
- Parameters
-
path | - the path of the source file stream |
- Returns
- A created dictionary
- Exceptions
-
+ (instancetype) dictionaryWithName: |
|
(NSString *) |
name |
|
Returns an empty dictionary created by using the specified dictionary name.
- Parameters
-
name | - the dictionary name |
- Returns
- A created dictionary
Creates and returns a dictionary containing a given object with the automatic generated key.
- Parameters
-
object | - the object to adding into the dictionary |
- Returns
- A new dictionary containing a single object
Creates and returns a dictionary containing a given key and object.
- Parameters
-
object | - the object corresponding to the specified key |
key | - the key for the specified object |
- Returns
- A new dictionary containing a single object for a single key
Creates and returns a dictionary containing objects from the specified nil terminated list and automatic generated keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - other objects to add to the new dictionary |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- A new dictionary containing the specified objects
Creates and returns a dictionary containing entries constructed from the contents of a collection of keys and a collection of objects.
- Parameters
-
objects | - a collection containing the objects for the new dictionary |
keys | - a collection containing the keys for the new dictionary |
- Returns
- A new dictionary containing entries constructed from the contents of the specified collections
+ (instancetype) dictionaryWithObjectsAndKeys: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Creates and returns a dictionary containing entries constructed from the specified set of objects and keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - first the key for the first object, then a null-terminated list of alternating objects and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- A new dictionary
+ (instancetype) dictionaryWithStream: |
|
(SCStream *) |
stream |
|
Returns a dictionary created by using the data from the specified stream.
- Parameters
-
stream | - the source stream |
- Returns
- A created dictionary
- Exceptions
-
Initializes an empty unnamed dictionary.
- Returns
- A newly initialized dictionary
- (instancetype) initWithCollection: |
|
(id<SCCollection>) |
collection |
|
Initializes a newly allocated dictionary with objects from the specified collection with automatic generated keys.
- Parameters
-
collection | - a collection with objects to add to the new dictionary |
- Returns
- An initialized dictionary with the objects from a given collection
- Exceptions
-
Reimplemented from SCCollection.
- (instancetype) initWithDictionary: |
|
(SCDictionary *) |
dictionary |
|
Initializes a newly allocated dictionary by placing in it the keys and objects contained in another given dictionary.
- Attention
- Designed initializer
- Parameters
-
dictionary | - a dictionary containing the keys and objects with which to initialize the new dictionary |
- Returns
- An initialized dictionary containing the keys and objects found in the specified source dictionary
- Exceptions
-
- (instancetype) initWithName: |
|
(NSString *) |
name |
|
Initializes an empty dictionary using the specified dictionary name.
- Attention
- Designed initializer
- Parameters
-
name | - the dictionary name |
- Returns
- A newly initialized dictionary
Initializes a newly allocated dictionary containing a given object with the automatic generated key.
- Parameters
-
object | - the object to adding into the dictionary |
- Returns
- An initialized dictionary containing a single object
Initializes a newly allocated dictionary containing a given key and object.
- Parameters
-
object | - the object corresponding to the specified key |
key | - the key for the specified object |
- Returns
- An initialized dictionary containing a single object for a single key
- (instancetype) initWithObjects: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Initializes a newly allocated dictionary containing objects from the specified nil terminated list and automatic generated keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - other objects to add to the new dictionary |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- An initialized dictionary containing the specified objects
Initializes a newly allocated dictionary containing entries constructed from the contents of a collection of keys and a collection of objects.
- Parameters
-
objects | - a collection containing the objects for the new dictionary |
keys | - a collection containing the keys for the new dictionary |
- Returns
- An initialized dictionary containing entries constructed from the contents of the specified collections
- (instancetype) initWithObjectsAndKeys: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Initializes a newly allocated dictionary with entries constructed from the specified set of objects and keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - first key for the first object, then a null-terminated list of alternating objects and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- An initialized dictionary
- (BOOL) isEqualToContentsOfDictionary: |
|
(SCDictionary *) |
dictionary |
|
Returns a boolean value that indicates whether the contents of the receiving dictionary are equal to the contents of another given dictionary.
- Parameters
-
dictionary | - the dictionary with which to compare the receiving dictionary |
- Returns
- YES if the contents of the specified dictionary are equal to the contents of the receiving dictionary, otherwise NO
Returns a boolean value that indicates whether the settings and contents of the receiving dictionary are equal to the settings and content of another given dictionary.
- Parameters
-
dictionary | - the dictionary with which to compare the receiving dictionary |
- Returns
- YES if the settings and contents of the specified dictionary are equal to the settings and contents of the receiving dictionary, otherwise NO
- (id) objectForKey: |
|
(NSString *) |
key |
|
Returns the object associated with a given key.
- Parameters
-
key | - the key for which to return the corresponding object |
- Returns
- The object associated with the specified key or nil if no object is associated with the key
- See also
- - valueForKey:
- (void) removeObjectForKey: |
|
(NSString *) |
key |
|
Removes a given key and its associated object from the receiving dictionary.
- Parameters
-
- Exceptions
-
- (void) removeObjectsForKeys: |
|
(SCArray *) |
keys |
|
Removes from the receiving dictionary entries specified specified by elements in a given array.
- Parameters
-
keys | - an array of objects specifying the keys to remove |
- Exceptions
-
Sets the settings and contents of the receiving dictionary to settings and entries in a given dictionary.
- Parameters
-
dictionary | - the source dictionary |
- Exceptions
-
Adds a given key-object pair to the dictionary.
- Parameters
-
object | - the object for the specified key |
key | - the key for the specified object |
- Exceptions
-
- See also
- - setValue:forKey:
Adds a key-object pairs from the specified collection of the objects and a given collection of the keys.
- Parameters
-
objects | - the collection of the objects |
keys | - the collection of the keys |
- Exceptions
-
- (void) setObjectsAndKeys: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Adds into the receiving dictionary entries cotsructed from the specified set of objects and keys.
- Parameters
-
object | - the first object to add to the dictionary |
... | - first the key for the first object, then a null-terminated list of alternating objects and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Exceptions
-
Adds a given key-value pair to the dictionary.
- Parameters
-
value | - the value for the specified key |
key | - the key for the specified value |
- Exceptions
-
- See also
- - setObject:forKey:
Adds a key-value pairs from the specified collection of the values and a given collection of the keys.
- Parameters
-
values | - the collection of the values |
keys | - the collection of the keys |
- Exceptions
-
- (void) setValuesAndKeys: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Adds into the receiving dictionary entries cotsructed from the specified set of values and keys.
- Parameters
-
object | - the first value to add to the dictionary |
... | - first the key for the first value, then a null-terminated list of alternating values and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Exceptions
-
- (id) valueForKey: |
|
(NSString *) |
key |
|
Returns the value associated with a given key.
- Parameters
-
key | - the key for which to return the corresponding value |
- Returns
- The value associated with a given key or nil if no value is associated with the key
- See also
- - objectForKey:
An array containing the all keys in the dictionary, or an empty array if the dictionary has no entries
An array containing the all values in the dictionary, or an empty array if the dictionary has no entries
- (NSEnumerator *) keyEnumerator |
|
readnonatomicretain |
An enumerator object that lets you access each key in the dictionary
The documentation for this class was generated from the following files: