encoding and archiving NSBitmapImageRep
encoding and archiving NSBitmapImageRep
- Subject: encoding and archiving NSBitmapImageRep
- From: Aaron Boothello <email@hidden>
- Date: Tue, 20 Jan 2004 21:21:27 +0800
Ive been getting to know NSCoder and NSArchiver/Unarchiver the last coupld of days and have most of it covered. Thanks for all your replie :-), i really appreciate it.
I got a question. I have an NSBitmapImageRep that i need to encode and archive as well...right now this is what im doing:
initializing the NSBitmapImageRep from a file(works fine):
image = [[NSImage alloc]initWithContentsOfFile:filename];
rep = [[NSBitmapImageRep alloc]initWithData: [image TIFFRepresentation]];
in the encodeWithCoder method, this is the line im using for the rep:
- (void) encodeWithCoder: (NSCoder *) aCoder
{
[aCoder encodeValueOfObjCType:@encode(NSBitmapImageRep *) at: &rep];
}
in the decode method:
- (id) initWithCoder: (NSCoder *) aDecoder
{
[aDecoder decodeValueOfObjCType:@encode(NSBitmapImageRep *) at: &rep];
}
but for some reason the rep dosent get loaded. i'm guessing it's got something to do with initializing the rep, but im not too sure. what do you guys think ? how do i solve this one ?
Cheers,
Aaron.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.