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

Re: Archiving NSError


  • Subject: Re: Archiving NSError
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Sun, 16 Nov 2008 16:15:23 +0100


Le 16 nov. 08 à 15:41, Vera Tkachenko a écrit :

Hello to mac developers :)
If I don't misunderstand things NSError objects can be archived because NSError implements NSCoding protocol.
I try to archive it as follows:

NSMutableDictionary * dict = [[NSMutableDictionary alloc] init];
NSError * error = [[NSError alloc] initWithDomain: @"TestDomain" code: 1 userInfo: nil];

[dict setObject:error forKey:@"Error"];
[dict setObject:@"OperationName" forKey:@"Operation"];
[dict writeToFile:@"/Users/ivira/temp" atomically:YES];


Without placing error into dict it work's ok. What am I doing wrong?

You try to serialize it not archiving it.

See this guide for the difference between the two technics:

http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/Archiving.html


_______________________________________________

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: 
 >Archiving NSError (From: Vera Tkachenko <email@hidden>)

  • Prev by Date: Archiving NSError
  • Next by Date: Re: Archiving NSError
  • Previous by thread: Archiving NSError
  • Next by thread: Re: Archiving NSError
  • Index(es):
    • Date
    • Thread