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

NSArchiver? try again


  • Subject: NSArchiver? try again
  • From: "Mark's Studio" <email@hidden>
  • Date: Thu, 30 Aug 2001 10:19:19 +0200

I'll try again

How to save more than one object?

I have made 2 Classes Object1 and Object2 with all the NSCoder stuff
and in MyDocument i have one NSMutableArray Object1DB and that works
fine.

But now i have another NSMutableArray Object2DB
but i can't 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? try again
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Fwd: Inherited constructors
  • Next by Date: Re: Subject: Inherited constructors
  • Previous by thread: Re: speed daemons
  • Next by thread: Re: NSArchiver? try again
  • Index(es):
    • Date
    • Thread