How do I set up NSZombieEnabled
and CFZombieLevel
for my executable in Xcode 4?
Objective-c – How to set up NSZombieEnabled in Xcode 4
nszombieobjective cxcodexcode4
Related Topic
- Xcode – How to enable NSZombie in Xcode
- Objective-c – How to disable ARC for a single file in a project
- Ios – Version vs build in Xcode
- Xcode – How to install Xcode Command Line Tools
- R – CMake: how do you copy private frameworks into the application bundle under OS X
- Ios – Xcode 7 error: “Missing iOS Distribution signing identity for …”
- Qt qmake – how to stop it adding rules to delete the target
- Xcode – Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)
Best Answer
In Xcode 4.x press
⌥⌘R
(or click
Menubar
>Product
>Scheme
>Edit Scheme
)select the "Diagnostics" tab and click "Enable Zombie Objects":
This turns released objects into NSZombie instances that print console warnings when used again. This is a debugging aid that increases memory use (no object is really released) but improves error reporting.
A typical case is when you over-release an object and you don't know which one:
-[UITableView release]: message sent to deallocated instance
This Xcode setting is ignored when you archive the application for App Store submission. You don't need to touch anything before releasing your application.
Pressing ⌥⌘R is the same as selecting Product > Run while keeping the Alt key pressed.
Clicking the "Enable Zombie Objects" checkbox is the same as manually adding "NSZombieEnabled = YES" in the section "Environment Variables" of the tab Arguments.