KiiUserFields Class Reference
Inherits from | NSObject |
Declared in | KiiUserFields.h |
Tasks
-
displayName
property -
country
property -
locale
property -
– setObject:forKey:
-
– hasObject:
-
– removeObjectForKey:
-
– getObjectForKey:
-
– removeFromServerForKey:
Properties
country
The country code associated with this user
@property (nonatomic, nullable) NSString *country
Discussion
The country code associated with this user
Declared In
KiiUserFields.h
Instance Methods
getObjectForKey:
Gets the value associated with the given key
- (nullable id)getObjectForKey:(NSString *)key
Parameters
- key
The key to retrieve
Return Value
An object if the key exists, nil otherwise
Discussion
Gets the value associated with the given key
Exceptions
- NSInvalidArgumentException
when key is nil/empty.
Declared In
KiiUserFields.h
hasObject:
Checks to see if an object exists for a given key
- (BOOL)hasObject:(NSString *)key
Parameters
- key
The key to check for existence
Return Value
True if the object exists, false otherwise.
Discussion
Checks to see if an object exists for a given key
Exceptions
- NSInvalidArgumentException
when key is nil/empty.
Declared In
KiiUserFields.h
removeFromServerForKey:
Remove a pair of key/value from UserFields.
- (void)removeFromServerForKey:(NSString *)key
Parameters
- key
to remove.
Discussion
Remove a pair of key/value from UserFields.
This pair is also removed from server when
Note:
Exceptions
- NSInvalidArgumentException
when key is nil/empty or equal to reserved key.
Declared In
KiiUserFields.h
removeObjectForKey:
Removes a specific key/value pair from the object
- (void)removeObjectForKey:(NSString *)key
Parameters
- key
The key of the key/value pair that will be removed
Discussion
Removes a specific key/value pair from the object
If the key exists, the key/value will be removed from the object.
Exceptions
- NSInvalidArgumentException
when key is nil/empty.
Declared In
KiiUserFields.h
setObject:forKey:
Sets a key/value pair to a KiiUser
- (BOOL)setObject:(id)object forKey:(NSString *)key
Parameters
- object
The value to be set. Object must be of a JSON-encodable type (Ex: NSDictionary, NSArray, NSString, NSNumber, etc)
- key
The key to set. The key must not be a reserved key (loginName, emailAddress, phoneNumber, displayName, country, userID) or begin with an underscore (_).
Return Value
True if the object was set, false otherwise.
Discussion
Sets a key/value pair to a KiiUser
If the key already exists, its value will be written over. If the object is of invalid type, it will return false. Accepted types are any JSON-encodable objects.
Exceptions
- NSInvalidArgumentException
when key is nil/empty; equal to reserved key; and/or object is nil.
Declared In
KiiUserFields.h