ℙℕℤℝ 2010-02-03 07:01
浏览 256
已采纳

如何在 Xcode 4中设置启用了 nszombiate?

How do I set up NSZombieEnabled and CFZombieLevel for my executable in Xcode 4?

转载于:https://stackoverflow.com/questions/2190227/how-do-i-set-up-nszombieenabled-in-xcode-4

  • 写回答

7条回答 默认 最新

  • elliott.david 2011-02-07 01:55
    关注

    In Xcode 4.x press

    <kbd>⌥</kbd><kbd>⌘</kbd><kbd>R</kbd>

    (or click Menubar > Product > Scheme > Edit Scheme)

    select the "Diagnostics" tab and click "Enable Zombie Objects":

    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:

    • With zombies: -[UITableView release]: message sent to deallocated instance
    • Without zombies: EXC_BAD_ACCESS

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(6条)

报告相同问题?