Skip to content

Instantly share code, notes, and snippets.

@funkyboy
Created April 1, 2014 14:03
Show Gist options
  • Select an option

  • Save funkyboy/9914606 to your computer and use it in GitHub Desktop.

Select an option

Save funkyboy/9914606 to your computer and use it in GitHub Desktop.
- (void) savePost:(id)sender {
self.post.postTitle = self.titleField.text;
self.post.postBody = self.bodyTextView.text;
[self.post saveObjectWithCompletion:^(id object, NSError *error) {
if (error == nil) {
NSLog(@"object saved");
self.post = object;
[[NSNotificationCenter defaultCenter] postNotificationName:@"POST_UPDATED"
object:nil];
[self.navigationController popViewControllerAnimated:YES];
}
else {
NSLog(@"error in updating %@", error);
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment