• 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: [warning, newbie] a new, saved, opened and closed again window causes app to crash (EXC_BAD_ACCESS)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [warning, newbie] a new, saved, opened and closed again window causes app to crash (EXC_BAD_ACCESS)


  • Subject: Re: [warning, newbie] a new, saved, opened and closed again window causes app to crash (EXC_BAD_ACCESS)
  • From: OS <email@hidden>
  • Date: Sun, 13 Mar 2005 08:50:21 +0100

I would expect that unarchiveObjectWithData returns an autoreleased object, so you don't own it and when you try to release it you will crash. Try using:
model = [[NSKeyedUnarchiver unarchiveObjectWithData:data] retain];
instead.

worked-like-a-charm :D

Always remember, only alloc, copy and retain give you an object that you are responsible for. All other methods are supposed to be returning autoreleased objects.

now you told me, it seems so evident... I didn't get into account that I wasn't allocing the object myself on init, but NSKeyedUnarchiver!


thanks Haris!

OS

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >[warning, newbie] a new, saved, opened and closed again window causes app to crash (EXC_BAD_ACCESS) (From: OS <email@hidden>)

  • Prev by Date: contextual menu question (newbie)
  • Next by Date: Filling an NSBezierPath with a texture
  • Previous by thread: [warning, newbie] a new, saved, opened and closed again window causes app to crash (EXC_BAD_ACCESS)
  • Next by thread: [warning, newbie] a new, saved, opened and closed again window causes app to crash (EXC_BAD_ACCESS)
  • Index(es):
    • Date
    • Thread