1

Unable to find Zombie in Instruments for device .

I am able to find Zombie in Instruments for Simulator but not able to find for device , my app only run on device due to addition of third party api.

How can i trace cause of crash due to "message sent to deallocated instance "

I just want to find exact instance(or line of code) which is causing this crash.

abhishekkharwar
  • 3,529
  • 2
  • 18
  • 31

2 Answers2

0

Although, when XCode returns "Message sent to deallocated instance" error message, it normally tells the Object as well which is sending that error.
Anyway, you can use the below to find the exact line which is causing you the error:

Use Exception BreakPoint for All Exceptions in XCode.
To Add an Exception Breakpoint:
1. Go to BreakPoint Navigator
2. At the bottom there is a plus symbol. Click it.
3. You will get two options: Add Exception Breakpoint... and Add Symbolic BreakPoint...
Choose Exception Breakpoint.

Puneet Sharma
  • 9,369
  • 1
  • 27
  • 33
0

Some reasons for zombies crash:
1. Control delegate response late after the control instance is cleared.
2. Instance used inside the thread try to modify the instance after its get cleared.

So handle the delegate properly

  1. Make control delegates to nil while removing view controller like this:

    - (void)viewDidDisappear:(BOOL)animated
    {
        [self.mapView setDelegate:nil];
        [_webView setDelegate:nil];
    }
    
Rahul Patel
  • 5,858
  • 6
  • 46
  • 72
Ganapathy
  • 4,594
  • 5
  • 23
  • 41