Tuesday, 27 August 2013

Trouble uploading info to Parse and performing segue with the same IBAction button

Trouble uploading info to Parse and performing segue with the same
IBAction button

I call this method:
- (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.message = message;
}
}];
}
When I run that by itself, it runs fine and the data class is created on
Parse. But when I add a segue to the same button, it performs the segue
and does not create the class on Parse. What can I do to make the same
IBAction button create the class on Parse BEFORE it performs the segue?

No comments:

Post a Comment