NSFileWrapper NSKeyedArchiver and Mutability
NSFileWrapper NSKeyedArchiver and Mutability
- Subject: NSFileWrapper NSKeyedArchiver and Mutability
- From: Trygve Inda <email@hidden>
- Date: Mon, 24 Jun 2013 15:53:41 -0700
- Thread-topic: NSFileWrapper NSKeyedArchiver and Mutability
NSMutableDictionary* myMutDict = [[NSMutableDictionary alloc] init];
NSData* myMutData = [NSKeyedArchiver archivedDataWithRootObject:myMutDict];
If I unarchive this, I was under the impression that it would return an
immutable object.
However, if I do:
NSFileWrapper* myWrapper = [[[NSFileWrapper alloc]
initRegularFileWithContents:myMutData ] autorelease];
[myWrapper setPreferredFilename:myDataName];
[[fileWrappers objectForKey:someKey] addFileWrapper: myWrapper];
And then later read it back in:
NSData* myData = [aWrapper regularFileContents];
NSMutableDictionary* aMutDict = [NSKeyedUnarchiver unarchiveObjectWithData:
myData ];
I end up with a mutable dictionary.
So...
Will NSKeyedArchiver / NSKeyedUnarchiver preserve mutability?
Will NSFileWrapper initRegularFileWithContents / regularFileContents
preserve mutability?
Thanks,
Trygve
_______________________________________________
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