EXC_BAD_ACCESS signal received

前端 未结 30 2727
轮回少年
轮回少年 2020-11-22 06:37

When deploying the application to the device, the program will quit after a few cycles with the following error:

Program received signal: \"EXC_BAD_ACCESS\".         


        
相关标签:
30条回答
  • 2020-11-22 07:15

    I forgot to return self in an init-Method... ;)

    0 讨论(0)
  • 2020-11-22 07:16

    The 2010 WWDC videos are available to any participants in the apple developer program. There's a great video: "Session 311 - Advanced Memory Analysis with Instruments" that shows some examples of using zombies in instruments and debugging other memory problems.

    For a link to the login page click HERE.

    0 讨论(0)
  • 2020-11-22 07:16

    Another method for catching EXC_BAD_ACCESS exceptions before they happen is the static analyzer, in XCode 4+.

    Run the static analyzer with Product > Analyze (shift+cmd+B). Clicking on any messages generated by the analyzer will overlay a diagram on your source showing the sequence of retains/releases of the offending object.

    enter image description here

    0 讨论(0)
  • 2020-11-22 07:16

    Forgot to take out a non-alloc'd pointer from dealloc. I was getting the exc_bad_access on my rootView of a UINavigationController, but only sometimes. I assumed the problem was in the rootView because it was crashing halfway through its viewDidAppear{}. It turned out to only happen after I popped the view with the bad dealloc{} release, and that was it!

    "EXC_BAD_ACCESS" [Switching to process 330] No memory available to program now: unsafe to call malloc

    I thought it was a problem where I was trying to alloc... not where I was trying to release a non-alloc, D'oh!

    0 讨论(0)
  • 2020-11-22 07:16

    How i deal with EXC_BAD_ACCESS

    Sometimes i feel that when a EXC_BAD_ACCESS error is thrown xcode will show the error in the main.m class giving no extra information of where the crash happens(Sometimes).

    In those times we can set a Exceptional Breakpoint in Xcode so that when exception is caught a breakpoint will be placed and will directly intimate the user that crash has happened in that line

    enter image description here

    0 讨论(0)
  • 2020-11-22 07:16

    I got it because I wasn't using[self performSegueWithIdentifier:sender:] and -(void) prepareForSegue:(UIstoryboardSegue *) right

    0 讨论(0)
提交回复
热议问题