Re: Dealing with NSError outside of the Responder chain
Re: Dealing with NSError outside of the Responder chain
- Subject: Re: Dealing with NSError outside of the Responder chain
- From: "Adam R. Maxwell" <email@hidden>
- Date: Tue, 27 May 2008 13:24:58 -0700
On Tuesday, May 27, 2008, at 12:40PM, "Paul Sargent" <email@hidden> wrote:
>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.
In general, I think you're supposed to add NSError** parameters to pass it back up to some class that knows how to present an error, but I find that's not always practical, and it tends to be messy. In such cases I typically take the easy way out and call [NSApp presentError:].
--
adam
_______________________________________________
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