Created a BOOL *myBool
variable in implementation file as below:
@interface myClass ()
{
BOOL *myBool;
}
- (void)viewDidLoad {
[super viewDidLoad];
myBool = false; // no error
}
- (IBAction)myBtnClickd:(UIButton *)sender {
if (!myBool) {
myBool = true; //error: incompatible integer to pointer conversion assigning to BOOL from int.
}
else {
myBool = false;
}
}
why I can not assign true to it and I am not assigning any int
as we can see in the code, I do not want to make it a property.