anotherCoder
anotherCoder

Reputation: 732

NSZombiEnabled settings

I am trying to check NSZombieEnabled is working in my code. I've the following settings :

enter image description here

enter image description here

enter image description here

and I've the following code in didFinishLaunchingWithOptions

NSString *string = nil;
    [string release];
    string = @"abc";

but, there is no error generated. there is no notification from NSZombie as well. Should I do some more settings. Please help me, cause I've a lib that I've imported and there is a EXC_BAD_ACCESS with code 13 happening, and I am not able to get to the error cause.

The stack and the console looks like this enter image description here

Upvotes: 0

Views: 129

Answers (1)

user1118321
user1118321

Reputation: 26395

Your settings are correct, but your code does not create any zombies. A zombie is an object which has been freed, but is re-used. Something like this will create a zombie:

NSString* string = [NSString stringWithString:@"abc"];
[string release];
[string length];

In this example, the string is released, and then you attempt to use it by calling its length method.

In the case of your library, what does the stack look like when it gives you the EXC_BAD_ACCESS?

Upvotes: 2

Related Questions