• 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: _NSKeyValueObservationInfoCreateByRemoving crashing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: _NSKeyValueObservationInfoCreateByRemoving crashing
      • From: mmalcolm crawford <email@hidden>
References: 
 >_NSKeyValueObservationInfoCreateByRemoving crashing (From: Stefan Fisk <email@hidden>)
 >Re: _NSKeyValueObservationInfoCreateByRemoving crashing (From: Nicko van Someren <email@hidden>)

  • Prev by Date: UpTime broken?
  • Next by Date: Re: Changes in CoreData/10.4.3?
  • Previous by thread: Re: _NSKeyValueObservationInfoCreateByRemoving crashing
  • Next by thread: Re: _NSKeyValueObservationInfoCreateByRemoving crashing
  • Index(es):
    • Date
    • Thread