我有NSRadioModeMatrix
3个细胞。- (IBAction) EnableProxy:(id)inSender
连接到NSRadioModeMatrix
- (IBAction) EnableProxy:(id)sender
{
if ([[sender selectedCell] tag]==2)
{
/*(gdb) p (int)[[inSender selectedCell] tag]
$1 = 2*/
if (condition) {
// select cell with tag 0
[sender selectCellAtRow:0 column:0]; // This is not working
}
/*(gdb) p (int)[[inSender selectedCell] tag]
$2 = 1*/
}
}// selection is not visible
当条件为真时。选择将返回到标签 2(旧的选定单元格)。示例项目。