Why my code changes the state of selected NSButtenCell to NSOnState after first run?
NSButtonCell *b=[[NSButtonCell alloc] init];
b=[self.myMatrix selectedCell];
[self.myMatrix selectCellAtRow:0 column:0];
if (b.state == NSOnState) {
NSLog(@"State is On");
}else{
NSLog(@"State is Off");
}
What can I do ?
I'm not sure but did you check whether calling
[self.myMatrix selectCellAtRow:0 column:0];
performs the state change?
The Apple documentation for NSMatrix says:
> If the specified cell is an editable text cell, its text is selected.
So perhaps this method also may change the checkbox state (but I don't know if that may be the issue).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With