• 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
Define NSError Domain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Define NSError Domain


  • Subject: Define NSError Domain
  • From: Johan Kool <email@hidden>
  • Date: Sat, 24 Sep 2005 00:52:57 +0100

Hello!

I am trying to do handling of errors in my application through use of
NSError. I hope someone can clarify a few things for me.

The documentation on NSError domains reads:

> You can create your own error domains and error codes for use in your own
> frameworks, or even in your own applications. It is recommended that the string
> constant for the domain be of the form com.company.framework_or_app.ErrorDomain.

But how do I define my own domains?

I understand that I can define my errors in this way (my adaption of
what I found in FoundationErrors.h):

enum {
    // Errors that might happen in my app
    JKMyOwnError = 100,				    // An error of my own
    JKAnotherError = 200,				    // Another error
};

How do I associated these errors with my own domain?

Thanks!

Johan
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Define NSError Domain
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: localization Q
  • Next by Date: Vertically centre text in Table Views
  • Previous by thread: Re: localization Q
  • Next by thread: Re: Define NSError Domain
  • Index(es):
    • Date
    • Thread