Skip to content

Instantly share code, notes, and snippets.

@moduscreate
Created April 1, 2015 17:52
Show Gist options
  • Save moduscreate/b808214c883be44f06d6 to your computer and use it in GitHub Desktop.
Save moduscreate/b808214c883be44f06d6 to your computer and use it in GitHub Desktop.
// Error Condition handling
if (writeError) {
// Craft a failure message
NSDictionary *resultsDict = @{
@"success" : @NO,
@"errMsg" : [writeError localizedDescription]
};
// Execute the JavaScript failure callback handler
failureCallback(@[resultsDict]);
}
// Success handling
else {
// Craft a success return message
NSDictionary *resultsDict = @{
@"success" : @YES
};
// Call the JavaScript sucess handler
successCallback(@[resultsDict]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment