10.2.5: NSDictionary(AGSAdditions) Category Reference
10.2.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
NSDictionary(AGSAdditions) Category Reference

Description

A category on NSDictionary containing convenience methods

Defined in:
NSDictionary+AGSAdditions.h ( ArcGIS library)

Since
1.0

Instance Methods

(NSDictionary *) - ags_encodeJSON
 
(NSString *) - ags_encodeQueryParams
 
(id) - ags_safeGetObjectForKey:
 
(id) - ags_safeObjectForKey:
 
(id) - ags_safeValueForKey:
 
(NSString *) - ags_stringByApplyingTemplate:
 
(NSURL *) - ags_URLForKey:
 

Method Documentation

- (NSDictionary *) ags_encodeJSON

Used for encoding of dictionary in order to simplify encoding to query parameters.

Since
1.0
- (NSString *) ags_encodeQueryParams

Used to encode dictionary into URL query parameter string.

Since
1.0
- (id) ags_safeGetObjectForKey: (id)  key

Returns the value associated with key from dict. If the value is equal to [NSNull null], the method will return nil.

Parameters
keyKey corresponding to the value to retrieve.
Returns
The value associated with the given key.
Deprecated:
Deprecated at 10.1.1 Use #safeValue:forKey: or #safeObject:forKey on NSDictionary instead.
Since
2.2
- (id) ags_safeObjectForKey: (id)  key

Returns the value associated with key from dict. Because this method is "safe", if the value is equal to [NSNull null], the method will return nil.

Parameters
keyKey corresponding to the value to retrieve.
Returns
The value associated with the given key.
Since
10.1.1
- (id) ags_safeValueForKey: (NSString *)  key

Returns the value associated with key from dict. If the value is equal to [NSNull null], the method will return nil.

Parameters
keyKey corresponding to the value to retrieve.
Returns
The value associated with the given key.
Since
10.1.1
- (NSString *) ags_stringByApplyingTemplate: (NSString *)  templateString

Used when retrieving a result from a dictionary when only the key name is available.

For example when retrieving the result of a query, with key "Display Name" available but not the value.

If the results look like this: { "Display Name" = "California", } and templateString = "${Display Name}"

The following method will return an NSString equal to "California".

Since
1.0
- (NSURL*) ags_URLForKey: (id)  key

Returns an NSURL for the given key. This method will account for unicode characters or spaces. If the value for the given key is not a string, this method will return nil.

Parameters
keyKey corresponding to the value to retrieve.
Returns
An NSURL object for the string value associated with the given key.
Since
10.1.1