RE: Open a file package
RE: Open a file package
- Subject: RE: Open a file package
- From: "Peter Karlsson" <email@hidden>
- Date: Sat, 9 Oct 2004 12:33:27 +0200
I think I got it now but I'm not sure.
If I want to open a package I do the following:
// package folder
NSFileWrapper *directory = [[NSFileWrapper alloc] initWithPath:@"/myFile"];
// one of the files inside the package (a serialized property list)
NSFileWrapper *file = [[directory fileWrappers] objectForKey:@"Property
List"];
// read the file to NSData
NSData *fileContent = [file regularFileContents];
// deserialize property list
myMutableArray = [NSDeserializer deserializePropertyListFromData:
fileContent mutableContainers: NO];
Is this the right way?
Peter
Ursprungligt meddelande
>
Dear list!
>
>
I have saved a file package with 2 files in it. One of the files is a
>
serialized property list, the other file a .tif image. How do I open the
>
package and read the 2 files back to my NSMutableArray and NSImage?
>
>
Best regards Peter
>
>
_______________________________________________
>
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
>
_______________________________________________
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