BBM Enterprise iOS SDK  R3
BBMLiveList Class Reference
Inheritance diagram for BBMLiveList:
BBMContainer

Instance Methods

(id) - objectAtIndexedSubscript:
 
(id) - valueAtIndex:
 
(NSUInteger) - countByEnumeratingWithState:objects:count:
 
(BOOL) - isStateCurrent
 YES if the list state is current. More...
 
(BOOL) - isStatePending
 YES if the list state is pending. More...
 
(BOOL) - isStateMissing
 YES if the list state is missing. More...
 
(BOOL) - containsIdentifier:
 YES if the list contains an object with the given primaryKey. More...
 
(id) - objectWithIdentifier:
 
(void) - addListener:
 
(void) - removeListener:
 
(void) - sendListMatchingRequest
 
- Instance Methods inherited from BBMContainer
(NSString *) - identifierOfElement:
 
(id) - objectForKeyedSubscript:
 
(void) - reset
 

Properties

NSUInteger count
 The number of elements in the list. More...
 
NSArray * array
 An array of the elements currently in the list. More...
 
BBMElementState bbmState
 Returns the current state of this instance. A current state means the live list is not waiting for any operations to complete. A pending state indicates this object is waiting for an operation to complete and the content will change soon. More...
 
NSArray * observableArray
 
- Properties inherited from BBMContainer
BBMDSModelmasterModel
 The top level container. required to resolve foreign keys. More...
 
NSString * type
 The container type. More...
 
NSString * listID
 The listID is only set if the container is not a singleton. More...
 
NSString * className
 The name of the class the container holds or vends. More...
 
Class classObject
 The class the container holds or vends. More...
 
void(^ allElementsReceivedCompletion )(NSArray *)
 

Detailed Description

BBMLiveList is a list container that automatically retrieves and updates the content via BBMDS.

The contained objects can be accessed with an NSArray-like interface. All objects are retrieved at once as soon as the list is created. The bbmState property indicates if the contents of the live list have been retrieved or if there is a pending operation.

Since
R3

Method Documentation

◆ addListener:()

- (void) addListener: (NSObject< BBMLiveListener > *)  listener

Adds a listener that will be informed when an element is added, removed or changed.

Since
R3

◆ containsIdentifier:()

- (BOOL) containsIdentifier: (NSString *)  primaryKey

YES if the list contains an object with the given primaryKey.

Since
R3

◆ countByEnumeratingWithState:objects:count:()

- (NSUInteger) countByEnumeratingWithState: (NSFastEnumerationState *)  state
objects: (__unsafe_unretained id *)  stackbuf
count: (NSUInteger)  len 

NSFastEnumeration Support

Since
R3

◆ isStateCurrent()

- (BOOL) isStateCurrent

YES if the list state is current.

Since
R3

◆ isStateMissing()

- (BOOL) isStateMissing

YES if the list state is missing.

Since
R3

◆ isStatePending()

- (BOOL) isStatePending

YES if the list state is pending.

Since
R3

◆ objectAtIndexedSubscript:()

- (id) objectAtIndexedSubscript: (NSUInteger)  index

Indexed subscripting.

id fistObject = myLiveList[0];
id lastObject = myLiveList[myLiveList.count - 1];
Since
R3

◆ objectWithIdentifier:()

- (id) objectWithIdentifier: (NSString *)  key

Returns the object in this list with the given identifier if it exists. This is an O(n) worst case, O(1) typically.

Since
R3

◆ removeListener:()

- (void) removeListener: (NSObject< BBMLiveListener > *)  listener

Removes a listener previously added by calling addListener:

Since
R3

◆ sendListMatchingRequest()

- (void) sendListMatchingRequest

Sends a request to update the list if there is a matching criteria set. Otherwise this call will be ignored.

Since
R3

◆ valueAtIndex:()

- (id) valueAtIndex: (NSUInteger)  index

Returns the value at a given index or nil if index is out of bounds.

Parameters
indexThis is the index of the value of interest.
Returns
The value of interest.
Since
R3

Property Documentation

◆ array

- (NSArray*) array
readnonatomicassign

An array of the elements currently in the list.

Since
R3

◆ bbmState

- (BBMElementState) bbmState
readnonatomicassign

Returns the current state of this instance. A current state means the live list is not waiting for any operations to complete. A pending state indicates this object is waiting for an operation to complete and the content will change soon.

Since
R3

◆ count

- (NSUInteger) count
readnonatomicassign

The number of elements in the list.

Since
R3

◆ observableArray

- (NSArray*) observableArray
readnonatomicassign

An observable version of .array. This triggers a KVO whenever the list has been updated for any reason. Use sparingly. This is much more accurate that observing count which may not trigger a KVO eventhough the underlying list of objects has changed.

Since
R3