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