• 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
Re: releasing NSKeyedUnarchiver causes crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: releasing NSKeyedUnarchiver causes crash


  • Subject: Re: releasing NSKeyedUnarchiver causes crash
  • From: Markus Spoettl <email@hidden>
  • Date: Sun, 18 May 2008 10:04:47 -0700

On May 18, 2008, at 5:25 AM, Klaus Backert wrote:
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError
{
*outError = nil;
NSKeyedUnarchiver *archiver;
archiver = [[NSKeyedUnarchiver alloc] initForReadingWithData: data];


   // release current data
   [tracks release];
   tracks = [archiver decodeObjectForKey: @"myobject"];
   [tracks retain];

may be because this is missing:

[archiver finishDecoding];


That wasn't it but thanks for helping.

The real reason was that I forgot to retain the objects decoded in tracks:initWithCoder: after decoding, so instead of

  timeStamp = [[decoder decodeObjectForKey:@"timeStamp"] retain];

I had

  timeStamp = [decoder decodeObjectForKey:@"timeStamp"];

and apparently the NSKeyedUnarchiver was the only think keeping that data alive.

Well, I apologize for wasting your time.

Regards
Markus
--
__________________________________________
Markus Spoettl

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: releasing NSKeyedUnarchiver causes crash
      • From: Jonathan Dann <email@hidden>
References: 
 >releasing NSKeyedUnarchiver causes crash (From: Markus Spoettl <email@hidden>)
 >releasing NSKeyedUnarchiver causes crash (From: Klaus Backert <email@hidden>)

  • Prev by Date: Re: NSTextView Font Substitution
  • Next by Date: Re: Working through a problem...
  • Previous by thread: releasing NSKeyedUnarchiver causes crash
  • Next by thread: Re: releasing NSKeyedUnarchiver causes crash
  • Index(es):
    • Date
    • Thread