SFSBuddyVariable Class Reference
| Inherits from | NSObject |
| Conforms to | BuddyVariable |
| Declared in | SFSBuddyVariable.h SFSBuddyVariable.m |
Overview
BuddyVariables are custom values attached to any Buddy in a BuddyList. They work with the same principle of the User/Room Variables.
The only difference is the logic by which they get propagated to other Users. While RoomVariables are broadcast to all clients in the same Room, BuddyVariables are updated to all Users who have the BuddyVariable owner in their BuddyLists.
BuddyVariables support basic data types and nested complex objects:
- Null
- Bool
- Int
- Double
- String
- SFSObject
- SFSArray
Also there is a special convention that allows certain Variables to be “offline” Buddy Variables. All variable names starting with a dollar sign ($) will set the BuddyVariable as persistent and make them available at any time whether the owner is online or not.
Tasks
-
nameThe Variable name
property -
typeThe Variable Type
property -
isOfflineReturn true if this is an offline Buddy Variable
property -
+ variableWithName:value:type:the name of the variable
-
– getValueThe Variable value
-
– getBoolValueThe Variable value as BOOL
-
– getIntValueThe Variable value as NSInteger
-
– getDoubleValueThe Variable value as Number
-
– getStringValueThe Variable value as NSString
-
– getSFSObjectValueThe Variable value as SFSObject
-
– getSFSArrayValueThe Variable value as SFSArray
-
– isNullChecks if the variable value is null
Properties
isOffline
Return true if this is an offline Buddy Variable
@property (readonly) BOOL isOfflineDiscussion
Return true if this is an offline Buddy Variable
By convention any Buddy Variable whose name starts with the dollar sign ($) will be regarded as persistent and stored locally by the server.
These variables are also referred to as “offline variables” because they are available to other Users even when the Buddy is offline.
Declared In
SFSBuddyVariable.hClass Methods
variableWithName:value:type:
the name of the variable
+ (id)variableWithName:(NSString *)name value:(id)value type:(NSInteger)typeParameters
- name
the name of the variable
- value
the variable value ( can be Boolean, int, Number, String, SFSObject, SFSArray )
- type
it’s usually not necessary to pass this parameter as the variable value is auto-detected (optional: pass -1 or use variableWithName:value:)
Declared In
SFSBuddyVariable.hInstance Methods
getBoolValue
The Variable value as BOOL
- (BOOL)getBoolValueDiscussion
The Variable value as BOOL
Declared In
SFSBuddyVariable.hgetDoubleValue
The Variable value as Number
- (NSNumber *)getDoubleValueDiscussion
The Variable value as Number
Declared In
SFSBuddyVariable.hgetIntValue
The Variable value as NSInteger
- (NSInteger)getIntValueDiscussion
The Variable value as NSInteger
Declared In
SFSBuddyVariable.hgetSFSArrayValue
The Variable value as SFSArray
- (id<ISFSArray>)getSFSArrayValueDiscussion
The Variable value as SFSArray
Declared In
SFSBuddyVariable.hgetSFSObjectValue
The Variable value as SFSObject
- (id<ISFSObject>)getSFSObjectValueDiscussion
The Variable value as SFSObject
See Also
Declared In
SFSBuddyVariable.hgetStringValue
The Variable value as NSString
- (NSString *)getStringValueDiscussion
The Variable value as NSString
Declared In
SFSBuddyVariable.h