Dealing with NSError outside of the Responder chain
Dealing with NSError outside of the Responder chain
- Subject: Dealing with NSError outside of the Responder chain
- From: Paul Sargent <email@hidden>
- Date: Tue, 27 May 2008 20:38:44 +0100
Hi,
I'm writing a model class that uses (in order to access on on disk
database) NSFileManager to read directory contents, and so I'm using
the method:
- (NSArray *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError
**)error
(directoryContentsAtPath is depreciated in 10.5, and this is the
replacement. Yes, I'm writing 10.5 or higher code)
My question is what is accepted practice when I get an NSError back?
Reading the Error Handling Programming Guide I get the idea that
errors can be passed up the responder chain so that the user can be
alerted, and take action. Thing is, as I said, this is in a model
class (super is NSObject), so it isn't a responder and not part of the
responder chain. Nor is this a document based app, so I'm not using
NSDocument or NSDocumentController.
I'd like to alert the user when things go wrong, but I don't see a way
of getting the NSError back to a responder. I feel like there's a
missing link somewhere.
Thanks
Paul
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden