It is always possible that the framework may encounter an error when performing a task, particularly when communicating with a device. Almost all of the framework methods return either NO or nil to indicate failure, but sometimes it is useful to know exactly what went wrong. Any method that indicates failure also has an error parameter, that can be used to return an NSError object. This object has the following properties:


The following shows an example of attempting to open a camera session and, if unsuccessful, presents an error dialog to the user.
//camera is an instance of EOSCamera

//declare the NSError object
NSError* error;

//attempt to open a camera session
BOOL success = [camera openSession:&error];

//if unsuccessful
if (!success){

    //present error to user
    [NSApp presentError:error];


The NSApplication's presentError method will, by default, produce a dialog similar to the one below.