• 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
Unarchiving Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unarchiving Problems


  • Subject: Unarchiving Problems
  • From: Craig Bakalian <email@hidden>
  • Date: Thu, 27 Mar 2003 05:28:06 -0500

Hi,

I am archiving a NSDocument Subclass like this -

- (NSData *)dataRepresentationOfType:(NSString *)aType
{
if([aType isEqualToString: @"EditTest"])
{
return [NSArchiver archivedDataWithRootObject: self];
}
return nil;
}

And I am unarchiving the beast like this -

- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType
{
if([aType isEqualToString: @"EditTest"])
{
TestDocument *temp;
temp = [NSUnarchiver unarchiveObjectWithData: data];
if(temp)
{
return YES;
}
}
return NO;
}

While debugging I see the temp's objects, and _fileName _fileType is
marked as invalid? I can't figure this one out. I am also having
trouble reloading a NSMutableArray called questions. questions is an
array of objects that have the <NSCoding> protocol. This is my coder
code in my NSDocument subclass.

-(void)encodeWithCoder: (NSCoder *)coder
{
[coder encodeRect: frame];
[coder encodeObject: questions];
}

-(id)initWithCoder: (NSCoder *)coder
{
frame = [coder decodeRect];
questions = [[coder decodeObject]retain];
return self;
}

The debugger gets through all this, yet while following the stack of
NSDocument methods I get to readFile: ofType: and whammo i get this
sucker -

*** malloc[862]: error for object 0xf64c40: Incorrect checksum for
freed object - object was probably modified after being freed; break at
szone_error
TestFactory has exited due to signal 10 (SIGBUS).

Anybody?




Craig Bakalian
www.eThinkingCap.com
_______________________________________________
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: Archiving and Dearchiving
  • Next by Date: Re: Component Manager Message...
  • Previous by thread: Re: Archiving and Dearchiving
  • Next by thread: PackageMaker meta package error 999
  • Index(es):
    • Date
    • Thread