Saturday, August 18, 2012

Debugging with ARC and Zombies enabled

If you tried to debug your app with zombies enabled under ARC, you may have noticed that you don’t get zombies anymore. That’s most probably because of a bug in the Foundation framework that affects iOS 5 and OS X 10.7. This bug prevents ARC from "cleaning up" instance variables at deallocation-time according to Apple Technical Q&A QA1758. Apple strongly encourages you to run your app on an iOS 6+, or OS X 10.8+ system when debugging with Zombies.
In the meantime, you can workaround this bug if you are using ARC and trying to debug zombies on older systems. Just compile this NSObject+ARCZombie.m file in your project and ivars will be automatically deallocated under ARC when zombies are enabled, as it should be.
Now you might think Hey, you are swizzling dealloc, isn't that dangerous? Well, yes it is, but note that the dealloc method is only swizzled when the NSZombieEnabled environment variable is enabled, so even if this code slips in your release build, il will cause no harm at all.

UPDATE: After I posted this, Greg Parker warned me on twitter:

@0xced That'll cause over-release of associated objects on some systems.

So use this workaround with care and remember that the best solution is what Apple recommends: run your app on an iOS 6+ or OS X 10.8+ system when debugging with Zombies.

32 comments:

ark console commands said...

In you say that the image view is also strongly referenced by the view controller, hence it won't be deallocated. However, as clearly shown in ImageViewViewController, the image view outlet is a weak reference. How come?



xcom 2 cheats said...

In 23:30 you say that the image view is also strongly referenced by the view controller, hence it won't be deallocated. However, as clearly shown in ImageViewViewController, the image view outlet is a weak reference. How come?


why do chia seeds gel said...

thx for posting this! animals are so rare now in alpha 16, I FINALLY found a stag and killed it then I lagged and selected my club instead of my knife and hit the carcass and it disappeared so I had to spawn in a new one I couldn't let that go :P


ck2-commands said...

thx for posting this! animals are so rare now in alpha 16, I FINALLY found a stag and killed it then I lagged and selected my club instead of my knife and hit the carcass and it disappeared so I had to spawn in a new one I couldn't let that go :P


trafficlogix said...

Good to see this: "Our smart solutions improve safety and prevent accidents at entryways, in facilities and on roadways of all kinds." radar feedback signs, radar trailers, radar speed display signs.

Odobenus rosmarus said...

Thank you for your help
https://arenasbo88.com/
https://www.gamesjoker123.net/
https://www.slotonlineosg777.com/
https://www.loginsbobett.com/
https://www.arenatangkasnet.com/
https://www.joker123gamings.com/

Odobenus rosmarus said...

Thank you for your understanding
https://sbobetkw.net/
http://www.daftar-pokeronline.net/
http://www.poker-idnplay.org/
http://www.idnpoker99apk.org/download-idn-poker/
https://www.akunidnplay.com/
http://www.idn-pokeronline.com/

Odobenus rosmarus said...

Thank you for the time
http://www.poker77apk.org/
https://www.idnpoker88asia.com/
http://www.daftarakunidnplay.com/
https://108.179.216.181/
http://www.poker99online.net/

Panthera leo said...

Thanks a ton for helping out
http://50.116.102.116/daftar-idn-poker/
http://www.sbobett888.com/
https://www.slotonlineplay1628.com/
http://www.idnplaypoker99.net/
https://www.casinowar88.info/daftar-casino-m88/

Panthera leo said...

Thank you for the time
http://162.241.233.33/
http://108.179.216.137/
http://50.116.102.128/
http://108.179.216.133/
http://108.179.216.118/

JannethManalu said...

Very interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know

Agen Bola Sbobet

POKERAMPM88 said...

Hello Please Visit My Website Too, IT must give you alot information
IDN Poker Indonesia
Poker Online Deposit Pulsa
Joker123 Terpercaya
Situs Slot Indonesia

Deriiin said...

daftar idn poker 99

daftar idn poker99

daftar poker99

daftar poker 99

daftar poker 99 online

daftar idnplay poker99

daftar poker999

register poker 99

Magick jack Customer Support Service Helpline Number said...

Nice Blog Post Thanks for sharing this.
The best part of this device is that you can get customer support service on phone.

www magicjack tech helpline number
magicjackcom support phone number
Magicjack Customer care phone number

fafaslot said...

Fafaslot

situs s128 said...

Agen Situs S128

agen fafaslot said...

Agen Fafaslot

vivoslot said...

Vivoslot

Agen Vivoslot said...

Vivoslot
Agen Vivoslot
Situs Vivoslot
Daftar Vivoslot
Login Vivoslot
Apk Vivoslot
Vivo slot

sumimasen said...

casino online
joker123

Joker388 said...

Joker388 game terbaik indonesia

https://sites.google.com/view/vivoslot-303/ said...

VIVOSLOT
JOKER123 CASINO
FAFASLOT
S128
S1288
SV388
JUDI POKER
S128
JUDI CEME
JUDI DOMINO

SonOfZeus said...

Great blog!
S128
Agen S128
Sv388
Situs Sv388
Judi Sv388
Club388

judi s128 said...

VIVOSLOT
FAFASLOT
S128
S128
S128
Situs IdnPlay
Ceme Indonesia
Joker123

vivoslot said...

SV388
vivoslot
FAFASLOT

Unknown said...

OSG777

Eirin Khoudia said...

Situs IDN Poker Indonesia merupakan situs resmi dari Developer terbesar di Asia yang ditunjuk sebagai salah satu situs terbaik di Indonesia yakni Pokervit.
Menyediakan Promo IDN Poker 2021 Menarik :
1. Bonus New Member 20%
2. Bonus Turnover Harian 3,5JT
3. Bonus Turnover Mingguan 0,5%
4. Bonus Refferal 10%
5. Menyediakan APK IDN Poker Indonesia 2021 Terbaru

Daftar IDN Poker Indonesia
Login IDN Poker Indonesia
Deposit IDN Poker Indonesia
Download IDN Poker Indonesia
Aplikasi IDN Poker Indonesia
APK IDN Poker Indonesia

IDN Poker Indonesia

Pusat Pendaftaran Akun ID Game Online Indonesia Terbaik | ADAPOKER303 said...

S128 APK
SV388
SV388 SABUNG AYAM
SV388
S128
POKER IDN
IDN POKER
DOMINO QQ ONLINE

mpo said...

BOKEP MEMEK

BOKEP SEKSUAL

BOKEP INDONESIA

BOKEP ASIA

Yurisa Lin said...

APK IDNPlay Deposit Pulsa 10rb Tanpa Potongan, kini sudah tersedia dan bisa kamu akses dengan mudah hanya dengan menggunakan 1 user id resmi IDN Poker Terbaru yakni Pokervit.

Dengan menggunakan APK IDNPlay IDN Poker 2021, Kamu sudah bisa mengakses semua jenis permainan idn yang sudah tersedia. Dengan minimal betting dimulai dari Rp 1.000 sampai Rp 5.000.

Tidak hanya itu saja, kamu juga berkesempatan untuk mendapatkan bonus new member 20%, Bonus Rollingan Harian, Bonus Rollingan Mingguan, dan Bonus Refferal 10% yang berlaku seumur hidup.

APK IDNPlay
Download APK IDNPlay

APK IDNPlay

muslera said...

Erkek spor ayakkabı arayanlar için liste:

1: erkek spor ayakkabı

2: erkek spor ayakkabı

3: erkek spor ayakkabı

4: erkek spor ayakkabı

5: erkek spor ayakkabı

6: erkek spor ayakkabı

joker123 said...

Selamat datang di layanan situs resmi indonesia game slot online uang asli di agen joker123 yang mana akan memberikan keuntungan bagi sobat yang ingin mencari keuntungan yang besar dalam waktu singkat maka di sini lah tempat nya.