Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracking down zombies with Xcode 5 on ios6

I have a zombie object somewhere in my code when it is run on iOS 6.1 but not in 7.

Unfortunately instruments will not run with zombies it pops up the following warning. "Zombies can only be run on devices with iOS 7 or later".

I don't really want to download an older version of Xcode as works internet is painfully slow.

What are some tips/tricks for hunting down the cause of this zombie as my normal goto approach is unavailable.

Any help would be greatly appreciated.

like image 459
Ben Avery Avatar asked Nov 20 '13 23:11

Ben Avery


People also ask

How do I find zombie objects in Xcode?

Zombies are objects having retain count 0 still continuing to exist. To confirm it enable zombies in product -> Edit Schemes -> Diagnostics , enable the check mark for Zombie objects.

What is zombie object swift?

Once an Objective-C or Swift object no longer has any strong references to it, the object is deallocated. Attempting to further send messages to the object as if it were still a valid object is a “use after free” issue, with the deallocated object still receiving messages called a zombie object.

What is zombie objects?

Zombie objects are a debugging feature of Cocoa / CoreFoundation to help you catch memory errors - normally when an object's refcount drops to zero it's freed immediately, but that makes debugging difficult.


1 Answers

From the menu bar, choose Project > Scheme > Edit Scheme… Click the Run item in the list on the left. Then click the Diagnostics tab on the right. Turn on the “Enable Zombie Objects” checkbox. Run your app from Xcode.

enable zombie objects checkbox

like image 152
rob mayoff Avatar answered Oct 24 '22 06:10

rob mayoff