-2

I am getting following message in log when app crashes

*** -[CFString release]: message sent to deallocated instance 0x1edf5720
[Switching to process 9223 thread 0x2407]
[Switching to process 9223 thread 0x2407]
[unknown][unknown][unknown][unknown][unknown][unknown][unknown][unknown][unknown][unknown](gdb)

My question is pretty simple, I just want to know which one is deallocated instance 0x1edf5720. I just want to know if there is any tool or some method by which i can know 0x1edf5720 is referring to which object Or where is the Zombie created exactly. Please note that i cann't use simulator to test. I must test it on device.

Thanks in advance.

ankit mehta
  • 23
  • 1
  • 6

2 Answers2

0

I think you are releasing the NSString without allocating it.

You have to release only if you are allocating the values.

For eg:

NSString * tempString=[[NSString alloc]init]; 

now [tempString release]; is valid.

if NSString * tempString=[NSString string]; or NSString * tempString=@"";

now [tempString release]; is not valid.

Venk
  • 5,949
  • 9
  • 41
  • 52
  • 1
    Another way of saying that is that it's being over-released. Either he issued a `release` to some `autoreleased` variable (like you said) or issued an extra `release` somehow. – Rob May 29 '13 at 05:27
0

Here one reason from bellow two options for crashed app.

1. You not allocated the variable of NSString and you release it.

OR

2. You already allocated but with autorelease propery like bellow..

   [[[NSString alloc] init] autorelease]; //Remove autorelease from here if you allocated with this keyword

Use NSZombieEnabled See the tutorial about that From this link NSZombieEnabled-iPhone

Paras Joshi
  • 20,427
  • 11
  • 57
  • 70
  • @ankitmehta i also add link about `NSZombieEnabled` in my answer above and also see the option above i posted.. :) – Paras Joshi May 29 '13 at 05:44
  • I added the NSZombieEnabled argument but how can i use to find out the object thats causing ? – ankit mehta May 29 '13 at 05:49
  • checkout this link http://stackoverflow.com/questions/2190227/how-do-i-set-up-nszombieenabled-in-xcode-4 and refer it dear :) hope its very helpful to you... – Paras Joshi May 29 '13 at 05:53