我收到以下错误:
警告:正在执行长时间运行的操作 线。打破warnBlockingOperationOnMainThread()进行调试。
代码如下:
- (IBAction)createButtonClicked:(id)sender {
PFObject *demoObject = [PFObject objectWithClassName:
@"Demo"]; // 1
[demoObject setObject:@"data value" forKey:@"dataColumn"]; // 2
[demoObject save]; // 3
}
答案 0 :(得分:1)
请尝试这种方式,
PFObject * demoObject = [PFObject objectWithClassName:@"Demo"];
demoObject[@"dataColumn"] = @"data value";
[demoObject saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error)
{
// take any action after saving.
}];