EXC_BAD_ACCESS signal received

前端 未结 30 2748
轮回少年
轮回少年 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:12

    This is an excellent thread. Here's my experience: I messed up with the retain/assign keyword on a property declaration. I said:

    @property (nonatomic, assign) IBOutlet UISegmentedControl *choicesControl;
    @property (nonatomic, assign) IBOutlet UISwitch *africaSwitch;
    @property (nonatomic, assign) IBOutlet UISwitch *asiaSwitch;
    

    where I should have said

    @property (nonatomic, retain) IBOutlet UISegmentedControl *choicesControl;
    @property (nonatomic, retain) IBOutlet UISwitch *africaSwitch;
    @property (nonatomic, retain) IBOutlet UISwitch *asiaSwitch;
    

提交回复
热议问题