To be honest, this is the intended behavior, and for good reason.

Given the above UI, if a user clicks on C
, they expect C
to become selected. If instead, a user clicks on C
and A
becomes selected, you have a confused (and potentially frustrated) user. Indeed, implementing this type of behavior violates the OS X Human Interface Guidelines for Radio Buttons.
That said, I'll move on to how you can implement the behavior you want. Basically, the reason why when you select C
, the immediate call to select A
doesn't seem to succeed is that, technically speaking, C
is still in the process of being selected. In other words, a simplified timeline of the events would look like the following:
- begin click on matrix
EnableProxy:
method called
- matrix immediately told to select
A
- finished click on matrix and
C
is finally completely selected
In order to achieve the results you want, instead of immediately telling the matrix to select A
, you'll need to "queue" the request up like the following code does:
- (IBAction) EnableProxy:(id)inSender {
if ([[inSender selectedCell] tag] == 2) {
// [mProxyEnable selectCellAtRow:0 column:0];
[self performSelector:@selector(selectFirstMatrixRow) withObject:nil
afterDelay:0.0];
}
}
- (void)selectFirstMatrixRow {
NSLog(@"[%@ %@]", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
[mProxyEnable selectCellAtRow:0 column:0];
}
By using [self performSelector:withObject:afterDelay:]
, you basically say "call this method as soon as possible". Doing so lets C
be fully selected before that method is called, which allows the results you want. In other words, the timeline of events would look like this:
- begin click on matrix
EnableProxy:
method called
- finished click on matrix and
C
is finally completely selected
- --------- control returns to normal event loop ---------
selectFirstMatrixRow
method called
- matrix selects
A