How do i resolve EXC_BAD_ACCESS errors encountered in iphone development

后端 未结 8 591
执念已碎
执念已碎 2020-12-13 20:54

I\'m trying to do a simple thing; read an image from the internet, save it to the app\'s documents directory on the iphone, and read it back from that file so that i can do

8条回答
  •  北海茫月
    2020-12-13 21:52

    One thing that helps me a lot is to have a breakpoint on objc_exception_throw. Anytime I'm about to get an exception thrown, I hit this breakpoint and I can debug back up the stack chain. I just leave this breakpoint enabled all the time in my iPhone projects.

    To do this, in xcode go to near the bottom of the left pane "Groups & Files" and find "Breakpoints". Open it and click on Project Breakpoints and in the detail pane (top), you'll see a blue field labeled "Double-Click for Symbol." Double-click on it and enter "objc_exception_throw".

    Next time you throw an exception, you'll stop and in the debugger, you can walk back up the stack chain to your code that caused the exception.

提交回复
热议问题