cocoa touch - What's the correct use of NSErrorRecoveryAttempting, NSError, and UIAlertView in iOS? -
i'm having trouble finding examples of correct way use nserror
, uialertview
, , nserrorrecoveryattempting
on ios. of documentation , examples can find cover equivalent functionality on os x, relevant behaviors integrated cocoa. in ios seems necessary do "by hand", , can't find examples of how it's done.
i'd appreciate few examples of best practice in using information in nserror support recovery attempts nserrors
reported user.
according apple's documentation:
important: nserror class available on both mac os x , ios. however, error-responder , error-recovery apis , mechanisms available in application kit (mac os x).
so, i'm not sure if can use nserrorrecoveryattempting
though appear defined in documentation (it looks area of uikit docs have not yet been updated after being copied appkit's documentation).
here how handle errors in code:
nserror *error = nil; id result = [someclass dosomething:&error]; if (!result) { nslog(@"do failed: %@", error); uialertview *alert = [[[uialertview alloc] initwithtitle:@"something failed!" message:@"there error doing something." delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil] autorelease]; [alert show]; return; }
Comments
Post a Comment