I am trying to debug my Autolayout using the suggestions of this website, to highlight views that are causing constraint issues. However when I try to change the color of the suspect view with the command
expr ((UIView *)0x7f9ea3d43410).backgroundColor = [UIColor redColor]
I get the Error
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0xcd4200020).
The process has been returned to the state before expression evaluation.
I have also gotten the error:
error: Execution was interrupted, reason: Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.
The process has been returned to the state before expression evaluation.
I am not sure why I am getting this error as I have made sure to replace the example hex code with my own, what does this error even mean?
I am coding in swift, the website I reference uses objective-c, that may be my problem. what would the swift code be to do the same thing? I have tried:
expr ((UIView *)0x7f9ea3d43410).backgroundColor = UIColor.redColor
question from:
https://stackoverflow.com/questions/65908897/why-am-i-getting-the-error-exc-bad-access 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…