• 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
encoding and archiving NSBitmapImageRep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: NSWindow with individual background
  • Next by Date: [SOLVED] Re: Panther broke CFUserNotificationDisplayNotice?
  • Previous by thread: Re: Authenthicate only once
  • Next by thread: [SOLVED] Re: Panther broke CFUserNotificationDisplayNotice?
  • Index(es):
    • Date
    • Thread