-
Notifications
You must be signed in to change notification settings - Fork 0
Adding Tables
cmancushman edited this page Oct 26, 2017
·
11 revisions
Declaration
+(void)createStackBaseTableWithName:(NSString *)name columns:(NSArray<StackBaseColumn *> *)columns withCompletionBlock:(StackBaseTableCompletion) compBlock;Example
[StackBaseClient createStackBaseTableWithName:@"TestTable"
columns:@[[StackBaseColumn textColumnWithName:@"Name"], [StackBaseColumn textColumnWithName:@"Memo"], [StackBaseColumn dateTimeColumnWithName:@"Timestamp" type:StackBaseDateTimeTypeTIMESTAMP]]
withCompletionBlock:^(BOOL success, NSString *responseMessage, StackBaseTable *table) {
if(success){
weakSelf.table = table;
NSLog(@"Table: %@", weakSelf.table);
}else{
NSLog(@"Operation Unsuccessful: %@", responseMessage);
}
}];Note
Repeated calls of this method will connect to the existing table found in your database rather than overwriting it with a new one.
Declaration
+(void)connectToStackBaseTableWithName:(NSString *)name withCompletionBlock:(StackBaseTableCompletion) compBlock;Example
[StackBaseClient connectToStackBaseTableWithName:@"TestTable"
withCompletionBlock:^(BOOL success, NSString *responseMessage, StackBaseTable *table) {
if(success){
NSLog(@"TestTable: %@", table);
}else{
NSLog(@"Operation Unsuccessful: %@", responseMessage);
}
}];Intro
Managing Tables
Managing Columns
Managing Rows
Conditions
Going Forward