• 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: controllers, delegates, retain, release ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: controllers, delegates, retain, release ...


  • Subject: Re: controllers, delegates, retain, release ...
  • From: Adam P Jenkins <email@hidden>
  • Date: Fri, 22 Feb 2008 18:10:09 -0500


On Feb 22, 2008, at 5:17 PM, Charles Steinman wrote:


--- Jack Repenning <email@hidden> wrote:

On Feb 22, 2008, at 1:13 PM, Keith Duncan wrote:
This would be a problem should the code base ever
be compiled with
GC support.

Interesting point, that retain/release supports a lifecycle model (free-floating, self-managed object) that can't be supported by GC....

I think it can. You'd just need to disable collection on the object and have it re-enable collection for itself when it decided it was no longer needed (this is essentially what CFRetain and CFRelease do under GC).

Where is this magic documented? The documentation for CFRetain doesn't mention this usage. The way I have seen documented is to use NSGarbageCollector's disableCollectorForPointer: and enableCollectorForPointer: methods. So you'd say:


[[NSGarbageCollector defaultCollector] disableCollectorForPointer:ui];

to cause ui to be ignored by the GC, and then

[[NSGarbageCollector defaultCollector] enableCollectorForPointer:ui];

when you want the GC to take over again. You're saying that CFRetain and CFRelease do the same thing, even for any Cocoa object?
_______________________________________________


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: controllers, delegates, retain, release ...
      • From: j o a r <email@hidden>
References: 
 >Re: controllers, delegates, retain, release ... (From: Charles Steinman <email@hidden>)

  • Prev by Date: Re: how can I pass file ref in objc scripting bridge (trying to add track to iTunes)
  • Next by Date: Re: Unobserved Changes
  • Previous by thread: Re: controllers, delegates, retain, release ...
  • Next by thread: Re: controllers, delegates, retain, release ...
  • Index(es):
    • Date
    • Thread