How to get the NSError message in iOS?

To get error message only, use:

NSString *msg = [error localizedDescription];

But for logging more details, use %@ format, like:

NSLog(@"Error: %@", error);

Normally you'll want to use [error localizedDescription] to get the text to show to the user.

Read the NSError documentation for more options.

For simple logging when developing, you can do NSLog(@"Error: %@", error). (That will give you 'localizedDescription' and everything else on your log in Xcode.)