ApptimizeVariable Class Reference
Inherits from | NSObject |
---|---|
Declared in | Apptimize+Variables.h |
Overview
This interface is used to create and retrieve dynamic variables.
The factory methods are used to create and register dynamic variables with the SDK. As they need to be declared prior to setting up an experiment, they should be called as early as possible during app execution, such as in didFinishLaunchingWithOptions.
All the factory methods return a reference to the created dynamic variable.
As dynamic variables are expected to be declared ahead of time during app startup, getters are provided to retrieve those dynamic variables at time of use.
Factory methods
+ stringWithName:andDefaultString:
Create a string dynamic variable with a specified name and default value.
+ (ApptimizeVariableString *_Nullable)stringWithName:(NSString *_Nonnull)name andDefaultString:(NSString *_Nonnull)defaultString
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultString |
The default NSString for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableString if no variable has been created before with this name. If an ApptimizeVariableString already exists with this name it returns the existing string variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a string dynamic variable with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ boolWithName:andDefaultBool:
Create a bool dynamic variable with a specified name and default value.
+ (ApptimizeVariableBool *_Nullable)boolWithName:(NSString *_Nonnull)name andDefaultBool:(BOOL)defaultBool
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultBool |
The default BOOL for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableBool if no variable has been created before with this name. If an ApptimizeVariableBool already exists with this name it returns the existing bool variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a bool dynamic variable with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ boolWithName:andDefaultNumber:
Create a bool dynamic variable with a specified name and default value.
+ (ApptimizeVariableBool *_Nullable)boolWithName:(NSString *_Nonnull)name andDefaultNumber:(NSNumber *_Nonnull)defaultNumber
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultNumber |
The default NSNumber (containing a BOOL) for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableBool if no variable has been created before with this name. If an ApptimizeVariableBool already exists with this name it returns the existing bool variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a bool dynamic variable with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ integerWithName:andDefaultInteger:
Create an integer dynamic variable with a specified name and default value.
+ (ApptimizeVariableInteger *_Nullable)integerWithName:(NSString *_Nonnull)name andDefaultInteger:(NSInteger)defaultInteger
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultInteger |
The default NSInteger for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableInteger if no variable has been created before with this name. If an ApptimizeVariableInteger already exists with this name it returns the existing integer variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create an integer dynamic variable with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ integerWithName:andDefaultUnsignedInteger:
Create an integer dynamic variable with a specified name and default value.
+ (ApptimizeVariableInteger *_Nullable)integerWithName:(NSString *_Nonnull)name andDefaultUnsignedInteger:(NSUInteger)defaultUnsignedInteger
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultUnsignedInteger |
The default NSUInteger for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableInteger if no variable has been created before with this name. If an ApptimizeVariableInteger already exists with this name it returns the existing integer variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create an integer dynamic variable with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ integerWithName:andDefaultNumber:
Create an integer dynamic variable with a specified name and default value.
+ (ApptimizeVariableInteger *_Nullable)integerWithName:(NSString *_Nonnull)name andDefaultNumber:(NSNumber *_Nonnull)defaultNumber
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultNumber |
The default NSNumber (containing an NSInteger or NSUInteger) for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableInteger if no variable has been created before with this name. If an ApptimizeVariableInteger already exists with this name it returns the existing integer variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create an integer dynamic variable with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ doubleWithName:andDefaultDouble:
Create a double dynamic variable with a specified name and default value.
+ (ApptimizeVariableDouble *_Nullable)doubleWithName:(NSString *_Nonnull)name andDefaultDouble:(double)defaultDouble
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultDouble |
The default double for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableDouble if no variable has been created before with this name. If an ApptimizeVariableDouble already exists with this name it returns the existing double variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a double dynamic variable with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ doubleWithName:andDefaultNumber:
Create a double dynamic variable with a specified name and default value.
+ (ApptimizeVariableDouble *_Nullable)doubleWithName:(NSString *_Nonnull)name andDefaultNumber:(NSNumber *_Nonnull)defaultNumber
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultNumber |
The default NSNumber (containing a double) for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableDouble if no variable has been created before with this name. If an ApptimizeVariableDouble already exists with this name it returns the existing double variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a double dynamic variable with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ stringArrayWithName:andDefaultArray:
Create a dynamic variable of an array containing strings with a specified name and default value.
+ (ApptimizeVariableArray *_Nullable)stringArrayWithName:(NSString *_Nonnull)name andDefaultArray:(NSArray *_Nonnull)defaultStringArray
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultStringArray |
The default NSArray (containing NSStrings) for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableArray if no variable has been created before with this name. If an ApptimizeVariableArray containing strings already exists with this name it returns the existing string array variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a dynamic variable of an array containing strings with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ boolArrayWithName:andDefaultArray:
Create a dynamic variable of an array containing bools with a specified name and default value.
+ (ApptimizeVariableArray *_Nullable)boolArrayWithName:(NSString *_Nonnull)name andDefaultArray:(NSArray *_Nonnull)defaultBoolArray
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultBoolArray |
The default NSArray (containing NSNumbers of BOOLs) for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableArray if no variable has been created before with this name. If an ApptimizeVariableArray containing bools already exists with this name it returns the existing bool array variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a dynamic variable of an array containing bools with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ integerArrayWithName:andDefaultArray:
Create a dynamic variable of an array containing integers with a specified name and default value.
+ (ApptimizeVariableArray *_Nullable)integerArrayWithName:(NSString *_Nonnull)name andDefaultArray:(NSArray *_Nonnull)defaultIntegerArray
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultIntegerArray |
The default NSArray (containing NSNumbers of integers) for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableArray if no variable has been created before with this name. If an ApptimizeVariableArray containing integers already exists with this name it returns the existing integer array variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a dynamic variable of an array containing integers with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ doubleArrayWithName:andDefaultArray:
Create a dynamic variable of an array containing doubles with a specified name and default value.
+ (ApptimizeVariableArray *_Nullable)doubleArrayWithName:(NSString *_Nonnull)name andDefaultArray:(NSArray *_Nonnull)defaultDoubleArray
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultDoubleArray |
The default NSArray (containing NSNumbers of doubles) for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableArray if no variable has been created before with this name. If an ApptimizeVariableArray containing doubles already exists with this name it returns the existing double array variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a dynamic variable of an array containing doubles with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ stringDictionaryWithName:andDefaultDictionary:
Create a dynamic variable of an dictionary with key/value pairs of string/string with a specified name and default value.
+ (ApptimizeVariableDictionary *_Nullable)stringDictionaryWithName:(NSString *_Nonnull)name andDefaultDictionary:(NSDictionary *_Nonnull)defaultStringDictionary
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultStringDictionary |
The default NSDictionary of NSStrings keyed with NSStrings for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableDictionary if no variable has been created before with this name. If an ApptimizeVariableDictionary containing strings already exists with this name it returns the existing string dictionary variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a dynamic variable of an dictionary with key/value pairs of string/string with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ boolDictionaryWithName:andDefaultDictionary:
Create a dynamic variable of an dictionary with key/value pairs of string/bool with a specified name and default value.
+ (ApptimizeVariableDictionary *_Nullable)boolDictionaryWithName:(NSString *_Nonnull)name andDefaultDictionary:(NSDictionary *_Nonnull)defaultBoolDictionary
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultBoolDictionary |
The default NSDictionary of NSNumbers (containing BOOLs) keyed with NSStrings for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableDictionary if no variable has been created before with this name. If an ApptimizeVariableDictionary containing bools already exists with this name it returns the existing bool dictionary variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a dynamic variable of an dictionary with key/value pairs of string/bool with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ integerDictionaryWithName:andDefaultDictionary:
Create a dynamic variable of an dictionary with key/value pairs of string/integer with a specified name and default value.
+ (ApptimizeVariableDictionary *_Nullable)integerDictionaryWithName:(NSString *_Nonnull)name andDefaultDictionary:(NSDictionary *_Nonnull)defaultIntegerDictionary
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultIntegerDictionary |
The default NSDictionary of NSNumbers (containing integers) keyed with NSStrings for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableDictionary if no variable has been created before with this name. If an ApptimizeVariableDictionary containing integers already exists with this name it returns the existing integer dictionary variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a dynamic variable of an dictionary with key/value pairs of string/integer with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
+ doubleDictionaryWithName:andDefaultDictionary:
Create a dynamic variable of an dictionary with key/value pairs of string/double with a specified name and default value.
+ (ApptimizeVariableDictionary *_Nullable)doubleDictionaryWithName:(NSString *_Nonnull)name andDefaultDictionary:(NSDictionary *_Nonnull)defaultDoubleDictionary
Parameters
name |
The name of the dynamic variable to create. |
---|---|
defaultDoubleDictionary |
The default NSDictionary of NSNumbers (containing doubles) keyed with NSStrings for this dynamic variable. |
Return Value
Returns a new ApptimizeVariableDictionary if no variable has been created before with this name. If an ApptimizeVariableDictionary containing doubles already exists with this name it returns the existing double dictionary variable but does not update the default value.
Returns nil if a variable of another type already exists with this name.
Discussion
Create a dynamic variable of an dictionary with key/value pairs of string/double with a specified name and default value.
See Also
Declared In
Apptimize+Variables.h
Getters
+ getStringForName:
Retrieve a string dynamic variable that has already been declared.
+ (ApptimizeVariableString *_Nullable)getStringForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableString if one has already been created with the specified name.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a string dynamic variable that has already been declared.
See Also
Declared In
Apptimize+Variables.h
+ getBoolForName:
Retrieve a bool dynamic variable that has already been declared.
+ (ApptimizeVariableBool *_Nullable)getBoolForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableBool if one has already been created with the specified name.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a bool dynamic variable that has already been declared.
See Also
Declared In
Apptimize+Variables.h
+ getIntegerForName:
Retrieve an integer dynamic variable that has already been declared.
+ (ApptimizeVariableInteger *_Nullable)getIntegerForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableInteger if one has already been created with the specified name.
Returns nil if no such variable exists with this name.
Discussion
Retrieve an integer dynamic variable that has already been declared.
See Also
Declared In
Apptimize+Variables.h
+ getDoubleForName:
Retrieve a double dynamic variable that has already been declared.
+ (ApptimizeVariableDouble *_Nullable)getDoubleForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableDouble if one has already been created with the specified name.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a double dynamic variable that has already been declared.
See Also
Declared In
Apptimize+Variables.h
+ getStringArrayForName:
Retrieve a string array dynamic variable that has already been declared.
+ (ApptimizeVariableArray *_Nullable)getStringArrayForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableArray if one has already been created with the specified name which contains strings.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a string array dynamic variable that has already been declared.
Declared In
Apptimize+Variables.h
+ getBoolArrayForName:
Retrieve a bool array dynamic variable that has already been declared.
+ (ApptimizeVariableArray *_Nullable)getBoolArrayForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableArray if one has already been created with the specified name which contains bools.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a bool array dynamic variable that has already been declared.
Declared In
Apptimize+Variables.h
+ getIntegerArrayForName:
Retrieve a integer array dynamic variable that has already been declared.
+ (ApptimizeVariableArray *_Nullable)getIntegerArrayForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableArray if one has already been created with the specified name which contains integers.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a integer array dynamic variable that has already been declared.
Declared In
Apptimize+Variables.h
+ getDoubleArrayForName:
Retrieve a double array dynamic variable that has already been declared.
+ (ApptimizeVariableArray *_Nullable)getDoubleArrayForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableArray if one has already been created with the specified name which contains doubles.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a double array dynamic variable that has already been declared.
Declared In
Apptimize+Variables.h
+ getStringDictionaryForName:
Retrieve a string dictionary dynamic variable that has already been declared.
+ (ApptimizeVariableDictionary *_Nullable)getStringDictionaryForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableDictionary if one has already been created with the specified name which contains strings.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a string dictionary dynamic variable that has already been declared.
Declared In
Apptimize+Variables.h
+ getBoolDictionaryForName:
Retrieve a bool dictionary dynamic variable that has already been declared.
+ (ApptimizeVariableDictionary *_Nullable)getBoolDictionaryForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableDictionary if one has already been created with the specified name which contains bools.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a bool dictionary dynamic variable that has already been declared.
Declared In
Apptimize+Variables.h
+ getIntegerDictionaryForName:
Retrieve an integer dictionary dynamic variable that has already been declared.
+ (ApptimizeVariableDictionary *_Nullable)getIntegerDictionaryForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableDictionary if one has already been created with the specified name which contains integers.
Returns nil if no such variable exists with this name.
Discussion
Retrieve an integer dictionary dynamic variable that has already been declared.
Declared In
Apptimize+Variables.h
+ getDoubleDictionaryForName:
Retrieve a double dictionary dynamic variable that has already been declared.
+ (ApptimizeVariableDictionary *_Nullable)getDoubleDictionaryForName:(NSString *_Nonnull)name
Parameters
name |
The name of the dynamic variable to retrieve. |
---|
Return Value
Returns an ApptimizeVariableDictionary if one has already been created with the specified name which contains doubles.
Returns nil if no such variable exists with this name.
Discussion
Retrieve a double dictionary dynamic variable that has already been declared.
Declared In
Apptimize+Variables.h