Errors and Exceptions

Respond to problem situations in your interactions with APIs, and fine-tune your app for better debugging.

Topics

User-Relevant Errors

NSError

Information about an error condition including a domain, a domain-specific error code, and application-specific information.

Assertions

NSAssertionHandler

An object that logs an assertion to the console.

NSAssert

Generates an assertion if a given condition is false.

NSAssert1

Generates an assertion if a given condition is false.

NSAssert2

Generates an assertion if a given condition is false.

NSAssert3

Generates an assertion if a given condition is false.

NSAssert4

Generates an assertion if a given condition is false.

NSAssert5

Generates an assertion if a given condition is false.

NSCAssert

Generates an assertion if the given condition is false.

NSCAssert1

Generates an assertion if a given condition is false.

NSCAssert2

Generates an assertion if a given condition is false.

NSCAssert3

Generates an assertion if a given condition is false.

NSCAssert4

Generates an assertion if a given condition is false.

NSCAssert5

Generates an assertion if a given condition is false.

NSCParameterAssert

Evaluates the specified parameter.

NSParameterAssert

Validates the specified parameter.

Exceptions

NSException

An object that represents a special condition that interrupts the normal flow of program execution.

Diagnostics and Debugging

NSLog

Logs an error message to the Apple System Log facility.

NSLogv

Logs an error message to the Apple System Log facility.

NSDeallocateZombies

A global variable that determines whether or not the memory of zombie objects is deallocated.

NSDebugEnabled

A global variable that can be used to enable debug behavior in your app, such as extra logging.

NSZombieEnabled

A global variable related to zombie objects that in practice has no effect.

NSKeepAllocationStatistics

A no-longer-used global variable related to keeping statistics.

See Also

App Support

Task Management

Manage your app’s work and how it interacts with system services like Handoff and Shortcuts.

Resources

Access assets and other data bundled with your app.

Notifications

Design patterns for broadcasting information and for subscribing to broadcasts.

App Extension Support

Manage the interaction between an app extension and its hosting app.

Scripting Support

Allow users to control your app with AppleScript and other automation technologies, or run scripts from within your app.