Skip to content

Adding Rows

cmancushman edited this page Oct 26, 2017 · 8 revisions

Add a Row

Declaration

-(void)addRows:(NSArray<NSDictionary *> *)rows completionBlock:(StackBaseEditCompletion) compBlock;

Example

[weakSelf.table addRows:@[@{@"Name" : @"Chris", @"Memo" : @"Checking in for the first time."}, @{@"Name" : @"Sean"}] 
completionBlock:^(BOOL success, NSString *responseMessage) {

    if(success){

        NSLog(@"Operation Successful");

    }else{

        NSLog(@"Operation Unsuccessful: %@", responseMessage);

    }

}];

Notes

  • Each dictionary's keys and values represent the column names and the data to be assigned to them, respectively. For each row created, the columns being assigned do not have to be the same. In the second row of the example, only the 'Name' column is fed data, while the other first given row assigns data to both 'Name' and 'Memo.'

  • When passing numeric values into rows (@"example_numeric_field" : @4) or conditions ([StackBaseCondition columnWithName:@"id" isEqualTo:@1]), the numbers must be formatted as NSNumbers or be prefixed with '@' in order to be processed by the backend.

Clone this wiki locally