• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dealing with NSError outside of the Responder chain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Dealing with NSError outside of the Responder chain
      • From: Paul Sargent <email@hidden>
References: 
 >Dealing with NSError outside of the Responder chain (From: Paul Sargent <email@hidden>)

  • Prev by Date: Re: Okay I have those pieces… now where's the glue?
  • Next by Date: Re: Okay I have those pieces… now where's the glue?
  • Previous by thread: Dealing with NSError outside of the Responder chain
  • Next by thread: Re: Dealing with NSError outside of the Responder chain
  • Index(es):
    • Date
    • Thread