Encoding/Decoding Multiple Objects in MyDocument
Encoding/Decoding Multiple Objects in MyDocument
- Subject: Encoding/Decoding Multiple Objects in MyDocument
- From: Jason Barker <email@hidden>
- Date: Thu, 27 Apr 2006 13:15:13 -0600
Newbie question:
I have a subclass of NSDocument (MyDocument) that has two mutable
arrays (array1 and array2) of objects. This is what I have for my
archiving and unarchiving methods:
- (NSData *)dataRepresentationOfType:(NSString *)aType {
return [NSKeyedArchiver archivedDataWithRootObject:array1];
}
- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType {
NSMutableArray *newArray;
newArray = [NSKeyedUnarchiver unarchiveObjectWithData:data];
if(newArray == nil) {
return NO;
} else {
[self setArray1:newArray];
return YES;
}
}
How do I set this up to archive and unarchive both arrays?
Thanks,
Jason
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden