Returning an NSString from an NSError Returning an NSString from an NSError objective-c objective-c

Returning an NSString from an NSError


-[NSError localizedDescription].

(Also, every ObjC object inherited from NSObject implements -description which returns an NSString.)


for folks new to objective c (me), following is example code that makes accepted answer from 'KennyTM' work ->

[self showAlertWithTitle:@"Error:" withMessage:error.localizedDescription];


You could try the localizedDescription method, which returns a string.

More in the docs.