Re: [[NSGarbageCollector defaultCollector] isEnabled] wrong?
Re: [[NSGarbageCollector defaultCollector] isEnabled] wrong?
- Subject: Re: [[NSGarbageCollector defaultCollector] isEnabled] wrong?
- From: Hsu <email@hidden>
- Date: Tue, 5 Feb 2008 18:34:15 -0800
Enable/disable/isEnabled allow you to temporarily suspend collection I
think.
Just check if [NSGarbageCollector defaultCollector] is nil or not.
Karl
On Feb 5, 2008, at 12:13 PM, Dominik Pich wrote:
Hi,
I want to assure GC is on for my app. I did try adding PRINT_GC=YES
to my Environment and THAT says that it is indeed on (or atleast
that my app requires it).
objc[3069]: GC: executable '/Users/dominik/Sources/objectiveC/
DimeTracker/build/Debug/DimeTracker.app/Contents/MacOS/DimeTracker'
requires GC
objc[3069]: GC: library '/System/Library/Frameworks/
ApplicationServices.framework/Versions/A/Frameworks/
CoreText.framework/Versions/A/CoreText' supports GC
objc[3069]: GC: library '/System/Library/PrivateFrameworks/
CoreUI.framework/Versions/A/CoreUI' supports GC
objc[3069]: GC: library '/System/Library/Frameworks/
QuartzCore.framework/Versions/A/QuartzCore' supports GC
objc[3069]: GC: library '/System/Library/Frameworks/Carbon.framework/
Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox'
supports GC
objc[3069]: GC: library '/System/Library/Frameworks/
CoreData.framework/Versions/A/CoreData' supports GC
objc[3069]: GC: library '/System/Library/Frameworks/
Foundation.framework/Versions/C/Foundation' supports GC
objc[3069]: GC: library '/System/Library/Frameworks/AppKit.framework/
Versions/C/AppKit' supports GC
objc[3069]: GC: library '/System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation' supports GC
objc[3069]: GC: library '/usr/lib/libobjc.A.dylib' supports GC
objc[3069]: GC: is ON
objc[3069]: GC: library '/System/Library/Frameworks/Carbon.framework/
Versions/A/Frameworks/CommonPanels.framework/Versions/A/
CommonPanels' supports GC
objc[3069]: GC: library '/System/Library/PrivateFrameworks/
HelpData.framework/Versions/A/HelpData' supports GC
objc[3069]: GC: library '/System/Library/PrivateFrameworks/
Shortcut.framework/Versions/A/Shortcut' supports GC
But asking NSGarbageCollector I get no for an answer:
- (void)awakeFromNib {
if([[NSGarbageCollector defaultCollector] isEnabled])
NSLog(@"GC on");
else
NSLog(@"GC off");
Did I simply not understand the docs right? Or..... is GC always off
during awakeFromNib or something?
Thanks,
Dominik
_______________________________________________
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:
@earthlink.net
This email sent to email@hidden
--
The day Microsoft makes something that doesn't suck is the day they
start making vacuum cleaners.
Homepage:
http://homepage.mac.com/khsu/index.html
_______________________________________________
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