how do I set up NSZombieEnabled,SAutoreleaseFreedObjectCheckEnabled,MallocStackLoggingNoCompact
these values though code.
I don't want to set up these values though Xcode edit scheme.Any idea?
Asked
Active
Viewed 422 times
1

Freak
- 6,786
- 5
- 36
- 54

ganvinalix
- 65
- 5
-
Out of curiosity, why do you want to do this in an iOS app? – Krumelur Nov 18 '12 at 11:12
1 Answers
0
On the iOS, this will be harder, since you need to execute the code before __CFInitialize
is run, and you don't have control over how images are loaded (at least, not if you plan on releasing your app on the store).
Sorry about the confusion, my previous answer was for OSX, and I (wrongly) assumed it would be the same on iOS, but after some thought, it isn't since you don't have dynamic libraries.

Krumelur
- 31,081
- 7
- 77
- 119
-
i do like this #ifdef DEBUG /*setenv("NSZombieEnabled", "YES", 1); setenv("NSDeallocateZombies", "YES", 1); // So leaks don't get mad. setenv("MallocStackLogging", "YES", 1); setenv("MallocStackLoggingNoCompact", "YES", 1); setenv("NSAutoreleaseFreedObjectCheckEnabled", "YES", 1); if (getenv("NSZombieEnabled")) { NSLog (@"NSZombieEnabled for debugging.") ; }*/ #endif – ganvinalix Nov 14 '12 at 11:12
-
but it doesn't work for me. but when i set the values though Xcode it does work – ganvinalix Nov 14 '12 at 11:28
-
May I ask what you are trying to do? Maybe there is another solution. – Krumelur Nov 20 '12 at 06:28
-
i don't want to manual set up those values every time, i seek a easy way. and where are you come from dude? it is my first time to post a question. you are so nice!!! – ganvinalix Nov 20 '12 at 09:07