Re: _NSKeyValueObservationInfoCreateByRemoving crashing
Re: _NSKeyValueObservationInfoCreateByRemoving crashing
- Subject: Re: _NSKeyValueObservationInfoCreateByRemoving crashing
- From: Stefan Fisk <email@hidden>
- Date: Tue, 1 Nov 2005 18:26:42 +0100
The Engine class only has one instance variable that identifies it,
so the copyWithZone: just calls initWithPath:. Anyways i copy engines
in lots of places in my code without any trouble whatsoever, and a
quick googling for my problem revealed that it is a known issue,
that's why i asked if anyone knew if the situation had changed, for
the last info i could find simply stated that there is a problem, but
noone knows exactly what or why.
1 nov 2005 kl. 18.10 skrev Nicko van Someren:
On 1 Nov 2005, at 16:50, Stefan Fisk wrote:
So basically:
Works for now, but is stopping me from adding planned features.
- (Engine *)engine {
return [[engine retain] autorelease];
}
Also works for now, but is stopping me from adding planned features.
- (Engine *)engine {
id old = [engine autorelease];
engine = [engine copy];
return old;
}
Crashes instantly, but it's the right thing to do.
- (Engine *)engine {
return [[engine copy] autorelease];
}
So, what does the implementation of -copyWithZone: look like for
the class Engine? Your crashes seem to be related to using the
copy; have you checked that the copy you get back is what you are
expecting?
You do know that NSObject doesn't implement the NSCopying protocol
and you have to do this yourself, don't you?
Nicko
_______________________________________________
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
_______________________________________________
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