一类中的方法:
- (IBAction)createGroup:(id)sender {
PFObject *message = [PFObject objectWithClassName:@"Messages"];
[message setObject:self.recipients forKey:@"recipientIds"];
[message saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (error) {
NSLog(@"Error %@ %@", error, [error userInfo]);
}
else [self performSegueWithIdentifier:@"showDate" sender:self];
}];
}
然后在另一个:
else {
PFQuery *message = [PFQuery queryWithClassName:@"Message"];
[message getObjectInBackgroundWithId:@"message" block:^(PFObject *message, NSError *error) {
[message setObject:file forKey:@"file"];
[message setObject:fileType forKey:@"fileType"];
[message setObject:[[PFUser currentUser] objectId] forKey:@"senderId"];
[message setObject:[[PFUser currentUser] username] forKey:@"senderName"];
[message saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
当我运行该应用程序时,没有错误或警告,但它会在访问查询时终止抛出错误。我敢肯定,当我一周前刚刚弹出我的编程樱桃时,我忽略了一些简单的事情。任何帮助将不胜感激。干杯!