FirebaseArray Class Reference

Inherits from NSObject
Declared in FirebaseArray.h

Overview

FirebaseArray provides an array structure that is synchronized with a Firebase reference or query. It is useful for building custom data structures or sources, and provides the base for FirebaseDataSource.

  delegate

The delegate object that array changes are surfaced to, which conforms to the FirebaseArrayDelegate Protocol.

@property (weak, nonatomic) id<FirebaseArrayDelegate> delegate

Discussion

The delegate object that array changes are surfaced to, which conforms to the FirebaseArrayDelegate Protocol.

Declared In

FirebaseArray.h

  query

The query on a Firebase reference that provides data to populate the instance of FirebaseArray.

@property (strong, nonatomic) FQuery *query

Discussion

The query on a Firebase reference that provides data to populate the instance of FirebaseArray.

Declared In

FirebaseArray.h

  snapshots

The delegate object that array changes are surfaced to.

@property (strong, nonatomic) NSMutableArray __GENERIC ( FDataSnapshot **snapshots

Discussion

The delegate object that array changes are surfaced to.

Declared In

FirebaseArray.h

– initWithRef:

Intitalizes FirebaseArray with a standard Firebase reference.

- (instancetype)initWithRef:(Firebase *)ref

Parameters

ref

The Firebase reference which provides data to FirebaseArray

Return Value

The instance of FirebaseArray

Discussion

Intitalizes FirebaseArray with a standard Firebase reference.

Declared In

FirebaseArray.h

– initWithQuery:

Intitalizes FirebaseArray with a Firebase query (FQuery).

- (instancetype)initWithQuery:(FQuery *)query

Parameters

query

A query on a Firebase reference which provides filtered data to FirebaseArray

Return Value

The instance of FirebaseArray

Discussion

Intitalizes FirebaseArray with a Firebase query (FQuery).

Declared In

FirebaseArray.h

– count

Returns the count of objects in the FirebaseArray.

- (NSUInteger)count

Return Value

The count of objects in the FirebaseArray

Discussion

Returns the count of objects in the FirebaseArray.

Declared In

FirebaseArray.h

– objectAtIndex:

Returns an object at a specific index in the FirebaseArray.

- (id)objectAtIndex:(NSUInteger)index

Parameters

index

The index of the item to retrieve

Return Value

The object at the given index

Discussion

Returns an object at a specific index in the FirebaseArray.

Declared In

FirebaseArray.h

– refForIndex:

Returns a Firebase reference for an object at a specific index in the FirebaseArray.

- (Firebase *)refForIndex:(NSUInteger)index

Parameters

index

The index of the item to retrieve a reference for

Return Value

A Firebase reference for the object at the given index

Discussion

Returns a Firebase reference for an object at a specific index in the FirebaseArray.

Declared In

FirebaseArray.h

– indexForKey:

Returns an index for a given object’s key (that matches the object’s key in the corresponding Firebase reference).

- (NSUInteger)indexForKey:(NSString *)key

Parameters

key

The key of the desired object

Return Value

The index of the object for which the key matches or -1 if the key is null

Discussion

Returns an index for a given object’s key (that matches the object’s key in the corresponding Firebase reference).

Exceptions

FirebaseArrayKeyNotFoundException

Thrown when the desired key is not in the FirebaseArray, likely indicating that the FirebaseArray is no longer being properly synchronized with the Firebase database.

Declared In

FirebaseArray.h