• 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
Using NSArchiver with NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSArchiver with NSDocument


  • Subject: Using NSArchiver with NSDocument
  • From: Weeks Family <email@hidden>
  • Date: Mon, 15 Sep 2003 21:29:16 -0400

Howdy,

I am creating an application using the the Cocoa multi-document
architecture. When I save my document (subclass of NSDocument) the
encodeWithCoder method gets called twice. The saved document opens
okay. I am concerned that the saved file is unnecessarily large and
that I really do have a problem but just don't know it yet.

You can reproduce this by creating a new Cocoa document-based
application project in Project Builder V2.1. Add this empty method to
MyDocument:
- (void)encodeWithCoder:(NSCoder *)coder
{
}
Replace the return line in this method:
- (NSData *)dataRepresentationOfType:(NSString *)aType
{
return [NSArchiver archivedDataWithRootObject:self];
}

Set breakpoints at each method, and run. The dataRepresentationOfType
gets called once as expected. encodeWithCoder gets called twice.

Thanks in advance to whomever can shed some light on my mystery.

John
_______________________________________________
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: Abba madness compare:options:range:
  • Next by Date: Compiling an x86 GPL software on a mac using gcc
  • Previous by thread: Re: Abba madness compare:options:range:
  • Next by thread: Re: Using NSArchiver with NSDocument
  • Index(es):
    • Date
    • Thread