LuxChat  2.0
Instant messenger for iOS
List of all members
FIRMutableData Class Reference

#import <FIRMutableData.h>

Inheritance diagram for FIRMutableData:

Instance Methods

Inspecting and navigating the data
(BOOL) - hasChildren
 
(BOOL) - hasChildAtPath:
 
(FIRMutableData *) - childDataByAppendingPath:
 

Properties

Properties
id value
 
id priority
 
NSUInteger childrenCount
 
NSEnumerator * children
 
NSString * key
 

Detailed Description

A FIRMutableData instance is populated with data from a Firebase Database location. When you are using runTransactionBlock:, you will be given an instance containing the current data at that location. Your block will be responsible for updating that instance to the data you wish to save at that location, and then returning using [FIRTransactionResult successWithValue:].

To modify the data, set its value property to any of the native types support by Firebase Database:

Note that changes made to a child FIRMutableData instance will be visible to the parent.

Method Documentation

- (FIRMutableData *) childDataByAppendingPath: (NSString *)  path

Used to obtain a FIRMutableData instance that encapsulates the data at the given relative path. Note that changes made to the child will be visible to the parent.

Parameters
pathA path string, consisting either of a single segment, like 'child', or multiple segments, 'a/deeper/child'
Returns
A FIRMutableData instance containing the data at the given path
- (BOOL) hasChildAtPath: (NSString *)  path

Indicates whether this mutable data has a child at the given path.

Parameters
pathA path string, consisting either of a single segment, like 'child', or multiple segments, 'a/deeper/child'
Returns
YES if this data contains a child at the specified relative path
- (BOOL) hasChildren

Returns boolean indicating whether this mutable data has children.

Returns
YES if this data contains child nodes.

Property Documentation

- (NSEnumerator*) children
readnonatomicstrong

Used to iterate over the children at this location. You can use the native for .. in syntax:

for (FIRMutableData* child in data.children) { ... }

Note that this enumerator operates on an immutable copy of the child list. So, you can modify the instance during iteration, but the new additions will not be visible until you get a new enumerator.

- (NSUInteger) childrenCount
readnonatomicassign
Returns
The number of child nodes at this location
- (NSString*) key
readnonatomicstrong
Returns
The key name of this node, or nil if it is the top-most location
- (id) priority
readwritenonatomicstrong

Set this property to update the priority of the data at this location. Can be set to the following types:

  • NSNumber
  • NSString
  • nil / NSNull to remove the priority
Returns
The priority of the data at this location
- (id) value
readwritenonatomicstrong

To modify the data contained by this instance of FIRMutableData, set this to any of the native types supported by Firebase Database:

  • NSNumber (includes BOOL)
  • NSDictionary
  • NSArray
  • NSString
  • nil / NSNull to remove the data

Note that setting this value will override the priority at this location.

Returns
The current data at this location as a native object

The documentation for this class was generated from the following file: