Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added error checking #1

Merged
merged 3 commits into from
Mar 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions 2014-03-07-icloud-core-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ While Apple hasn’t released official sample code for iCloud Core Data in iOS 7
NSError *error;

if ([context hasChanges]) {
[context save:&error];
BOOL success = [context save:&error];

if (!success && error) {
// perform error handling
NSLog(@"%@",[error localizedDescription]);
}
}

[context reset];
Expand Down Expand Up @@ -220,4 +225,4 @@ It’s no secret that iCloud Core Data was fundamentally broken in iOS 5 and 6,
*Special thanks to Andrew Harrison, Greg Pierce, and Paul Bruneau for their help with this article.*


[^1]: In previous OS versions, this method wouldn’t return until iCloud data was downloaded and merged into the persistent store. This would cause significant delays, meaning that any calls to the method would need to be dispatched to a background queue. Thankfully, this is no longer necessary.
[^1]: In previous OS versions, this method wouldn’t return until iCloud data was downloaded and merged into the persistent store. This would cause significant delays, meaning that any calls to the method would need to be dispatched to a background queue. Thankfully, this is no longer necessary.