-
Notifications
You must be signed in to change notification settings - Fork 0
Updating Rows
cmancushman edited this page Oct 26, 2017
·
3 revisions
When querying for rows, StackBaseCondition objects are often used to help refine results. To understand these better, take a look at the docs for StackBaseCondition.
Declaration
-(void)updateRowsThatSatisfyTheCondition:(StackBaseCondition *)condition withFieldsAndValues:(NSDictionary *)fieldsAndValues completionBlock:(StackBaseEditCompletion) compBlock;Example
[weakSelf.table updateRowsThatSatisfyTheCondition:[StackBaseCondition columnWithName:@"Name" isEqualTo:@"Sean"]
withFieldsAndValues:@{@"Memo" : @"Hey Chris! This is my first memo. Am I doing this right?"}
completionBlock:^(BOOL success, NSString *responseMessage) {
if(success){
NSLog(@"Update Successful.");
}else{
NSLog(@"Update Unsuccessful: %@", responseMessage);
}
}];Note
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.
Intro
Managing Tables
Managing Columns
Managing Rows
Conditions
Going Forward