• 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
Presenting NSLocalizedFailureReasonErrorKey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Presenting NSLocalizedFailureReasonErrorKey


  • Subject: Presenting NSLocalizedFailureReasonErrorKey
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 1 Oct 2007 11:15:49 -0700

Method -presentError: presents a modal dialog showing an NSError. It shows the domain and the code, but not the NSLocalizedFailureReasonErrorKey from the userInfo dictionary. Why not? I must be doing something wrong. Is not NSLocalizedFailureReasonErrorKey far more informative to the user than the domain or code number?

Jerry Krinock

TEST CODE:

NSDictionary *userInfo ;
userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
    @"That dog won't hunt.", NSLocalizedFailureReasonErrorKey,
    nil] ;

NSError* error ;
error = [NSError errorWithDomain:@"com.MyCompany.ErrorDomain"
                            code:123
                        userInfo:userInfo] ;

[[NSApplication sharedApplication] presentError:error] ;

EXPECTED RESULT:
A modal dialog saying something like:
  "That dog won't hunt.  com.MyCompany.ErrorDomain error #123"

ACTUAL RESULT:
A modal dialog saying only:
  "com.MyCompany.ErrorDomain error #123"


_______________________________________________

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: Presenting NSLocalizedFailureReasonErrorKey
      • From: Hank Heijink <email@hidden>
  • Prev by Date: Re: id type used as token and Distributed Objects
  • Next by Date: Re: NSView subview backgrounds
  • Previous by thread: Re: id type used as token and Distributed Objects
  • Next by thread: Re: Presenting NSLocalizedFailureReasonErrorKey
  • Index(es):
    • Date
    • Thread