When I run Project/Profile in Xcode and choose "Zombies", the app runs in the simulator with "NSZombie detection
" enabled. But what should I be looking for to tell me that there is a problem? All I see is the Allocation instrument running and the statistics below. Where will it actually show me that a Zombie
was detected?
To confirm it enable zombies in product -> Edit Schemes -> Diagnostics , enable the check mark for 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.
Overview. 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.
You need to open the Product menu in the Xcode, select Edit scheme and then choose the Diagnostics tab. There you have "Enable Zombie Objects". Once selected and run in debugger will point you to the double released object! Enjoy!
You will get the leak above the object allocation bar. Check this image;
For a reference, check this video
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With