This screenshot explains it all:
The screenshot shows the debugger reporting buttonType as 2 but the console showing button type = 0. The same variable is being shown in the debugger and the console. Any idea how this mismatch happens?
(gdb) po ((UIButton *)control).buttonType
There is no member named buttonType.
As requested:
NSLog(@"################ CALL OUT ACCESSORY TAPPED: set pinColor to RED in call out accessory tapped");
NSLog(@"################ CALL OUT ACCESSORY TAPPED: UIButtonTypeDetailDisclosure = %d",UIButtonTypeDetailDisclosure);
NSLog(@"################ CALL OUT ACCESSORY TAPPED: control button type = %d", ((UIButton *)control).buttonType);
if (((UIButton *)control).buttonType == 2) {
NSLog(@" ############# CALL OUT ACCESSORY TAPPED: in buttonType = disclosure");
leftCallOutButton.available = YES;
}
The if statements evaluates to false!! Trying to understand why if buttonType is being reported as 2 (and if fact is created with type 2 )
as request by Mike:
(gdb) p (int) [((UIButton *)control) buttonType]
$1 = 0
2009-12-31 14:04:26.821 iParkNow![4432:207] ################ CALL OUT ACCESSORY TAPPED: control button type = 0
(gdb) p (int) [((UIButton *)control) buttonType]
Ok, so this makes more sense. The question now is why is the buttonType being changed from 2 to 0? Its created with buttonType 2 and somehow gets changed to 0. Any ideas??