EXC_BAD_ACCESS signal received

前端 未结 30 3284
轮回少年
轮回少年 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 06:54

    I've been debuging, and refactoring code to solve this error for the last four hours. A post above led me to see the problem:

    Property before: startPoint = [[DataPoint alloc] init] ; startPoint= [DataPointList objectAtIndex: 0];
    . . . x = startPoint.x - 10; // EXC_BAD_ACCESS

    Property after: startPoint = [[DataPoint alloc] init] ; startPoint = [[DataPointList objectAtIndex: 0] retain];

    Goodbye EXC_BAD_ACCESS

提交回复
热议问题