• 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: NSError in NSDocument readFromURL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSError in NSDocument readFromURL


  • Subject: Re: NSError in NSDocument readFromURL
  • From: Chris Miner <email@hidden>
  • Date: Wed, 15 Jul 2009 13:15:07 +0200


Am 13.07.2009 um 00:50 schrieb Konrad Windszus:

If I set an NSError in the method readFromURL of my NSDocument, I am not able to overwrite the NSLocalizedDescriptionKey.
If have the following code in that method:



I guess for the desired (expected?) effect the code should look like:

- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError
{
NSArray *objArray = [NSArray arrayWithObjects:@"Description", @"FailureReason", @"RecoverySuggestion", nil];
NSArray *keyArray = [NSArray arrayWithObjects:NSLocalizedDescriptionKey, NSLocalizedFailureReasonErrorKey, NSLocalizedRecoverySuggestionErrorKey, nil];
NSDictionary *eDict = [NSDictionary dictionaryWithObjects:objArray forKeys:keyArray];


[self presentError:[NSError errorWithDomain:@"myDomain" code:1 userInfo:eDict]];

// fill outError
*outError = [NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil];
return NO;
}


_______________________________________________

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


References: 
 >NSError in NSDocument readFromURL (From: Konrad Windszus <email@hidden>)

  • Prev by Date: Re: iPhone cannot compile 2.2 SDK application for 3.0 SDK
  • Next by Date: Re: iPhone cannot compile 2.2 SDK application for 3.0 SDK
  • Previous by thread: Re: NSError in NSDocument readFromURL
  • Next by thread: Window Resize with Animator Proxy: Window Contents Jump Around
  • Index(es):
    • Date
    • Thread