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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to