有没有办法使用 swift2 创建表并将数据保存在 backendless.com 数据库中?我只找到了 Objective-C 的代码。
Objektiv-C 代码:
-(void)saveNewContact
{
Responder *responder = [Responder responder:self selResponseHandler:@selector(responseHandler:) selErrorHandler:@selector(errorHandler:)];
Contact *contact = [Contact new];
contact.age = 21;
contact.title = @"title";
contact.name = @"name";
contact.phone = @"555-555-555";
id<IDataStore> dataStore = [backendless.persistenceService of:[Contact class]];
[dataStore save:contact responder:responder];
}
网址:https ://backendless.com/documentation/data/ios/data_saving_data_objects.htm