Monday, December 16, 2013

EXC_BAD_ACCESS iOS ( iPhone ) OR iOS EXC_BAD_ACCESS causes crash



  1. Set "Enable Zombie Objects" means NSZombieEnabled. which helps to find cause sometime.  To set the same go to  Menubar > Product > Scheme > Edit Scheme.   This optionwill provide a warning in logs  when you try to access an object that has been deallocated. That is the cause for crash.
                             2.Find memory leaks in your app. Use Leak instrument for to find  memory leaks  
    1. Open the Leaks instrument Menubar > Xcode > Open Developer tool > Instrument 
    2. Choose your app from the Choose Target pop-up menu
    3. Click the Record button.
    4. Exercise your app to execute code, and click the Stop button when leaks are displayed.
    5. Click any leaked object that is identified in the Detail pane.
    6. Within the Extended Detail pane, double-click an instruction from your code.
    7. Click the Xcode icon in the Detail pane to open that code in Xcode.
3. Analyse code . Find possible chances part of code .s et a breakpoint in that part of code and step through until you find crashing

4.Another way is comment part by part code and check which part of code is causing it

0 comments:

Post a Comment

About

Powered by Blogger.