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

NSArchiver?


  • Subject: NSArchiver?
  • From: "Mark's Studio" <email@hidden>
  • Date: Wed, 29 Aug 2001 09:59:26 +0200

How to save more than one object?

In MyDocument i have one Object1DB and i can read and write that but i
can figure out how to setup dataRepresentationOfType and readFromFile if
i have more than one object.

- (NSData *)dataRepresentationOfType:(NSString *)aType
{
return [NSArchiver archivedDataWithRootObject:Object1DB];
}

- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)docType
{
[self setObject1DB:[NSUnarchiver
unarchiveObjectWithFile:fileName]];
return YES;
}

Thanks
Peter Mark

Mark's Recording Studio A/S
Faelledvej 19 b DK2200 N
Copenhagen Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden


  • Follow-Ups:
    • Re: NSArchiver?
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Abstract classes and methods
  • Next by Date: RE: Abstract classes and methods
  • Previous by thread: Re: Subject: Is K&R Still Relevant?
  • Next by thread: Re: NSArchiver?
  • Index(es):
    • Date
    • Thread