• 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: Nicko van Someren <email@hidden>
  • Date: Tue, 1 Nov 2005 17:10:53 +0000

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


  • Follow-Ups:
    • Re: _NSKeyValueObservationInfoCreateByRemoving crashing
      • From: Stefan Fisk <email@hidden>
References: 
 >_NSKeyValueObservationInfoCreateByRemoving crashing (From: Stefan Fisk <email@hidden>)

  • Prev by Date: Re: private frameworks
  • Next by Date: Scroll wheels - typical deltas?
  • Previous by thread: _NSKeyValueObservationInfoCreateByRemoving crashing
  • Next by thread: Re: _NSKeyValueObservationInfoCreateByRemoving crashing
  • Index(es):
    • Date
    • Thread