• 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: Transitioning to GC-supported
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transitioning to GC-supported


  • Subject: Re: Transitioning to GC-supported
  • From: Dave Keck <email@hidden>
  • Date: Mon, 26 Oct 2009 17:43:58 -1000

>> 4. Search for every call to -retain, -alloc, -init pairs, and -copy.
>> Verify that the object being retained is strongly referenced, and if not, it must
>> be CFRetain()ed or -disableCollectorForPointer: must be called for it.
>
> I'm not sure what you mean by this.

For example, I have an object that [self retain]; while it does some
work that takes awhile. I don't hold a reference to this object
anywhere after it's created - it simply notifies its delegate when its
finished. In this case, this object would need to CFRetain itself to
keep itself alive.

>> 6. Search for every use of '&', and use objc_assign_global() and
>> objc_assign_ivar() as necessary.
>
> I don't know what you mean by this.

I'm not sure either. :) This is on my list of things to understand
better, but I mentioned it after reading "Global Object Pointers",
here:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcUsing.html

> In summary, I think what you're saying is formally correct, but you're
> overestimating the amount of trouble. I have converted significant amounts
> of code to be GC-compatible, and only ran into minor problems. The biggest
> thing to watch out for is mixing CF and NS types, and mostly you just need
> to insert an NSMakeCollectable call to take care of those. It's really not
> that bad.

Thanks for the reassurance. I tend to be pretty obsessive over my code
(as I'm sure you can tell) which can be a good and a bad thing.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Transitioning to GC-supported
      • From: Jens Alfke <email@hidden>
References: 
 >Transitioning to GC-supported (From: Dave Keck <email@hidden>)
 >Re: Transitioning to GC-supported (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately
  • Next by Date: first responder being clobbered
  • Previous by thread: Re: Transitioning to GC-supported
  • Next by thread: Re: Transitioning to GC-supported
  • Index(es):
    • Date
    • Thread