Created
December 2, 2017 18:45
-
-
Save bouchtaoui-dev/b62aa38a19b03efdabda2133bb58a178 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(NSString *) someMethod:(int) id withError:(NSError **)errorPtr{ | |
| if(id == 1) | |
| { | |
| return @"Execution of some code..."; | |
| } | |
| else | |
| { | |
| NSString *domain = @"com.MyCompany.MyApplication.ErrorDomain"; | |
| NSString *desc =@"Unable to complete the process"; | |
| NSDictionary *userInfo = [[NSDictionary alloc] | |
| initWithObjectsAndKeys:desc, | |
| @"NSLocalizedDescriptionKey",NULL]; | |
| *errorPtr = [NSError errorWithDomain:domain code:-101 | |
| userInfo:userInfo]; | |
| return @""; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment