这个屏幕截图解释了这一切:
屏幕截图显示调试器报告按钮类型为2,但控制台显示按钮类型为0。调试器和控制台中显示了相同的变量。知道这种不匹配是怎么发生的吗?
(gdb)po((uibutton*)control).buttonType
< /代码>
没有名为buttonType的成员。
按要求:
nslog(@“call out accessory tapped:set pincolor to red in call out accessory tapped”);
nslog(@“调出抽头附件:uibuttontypetaildisclosure=%d”,uibuttontypetaildisclosure);
nslog(@“调出附件抽头:控制按钮类型=%d”,((uibutton*)控制按钮类型);
if(((uibutton*)控件).buttonType==2){
nslog(@“________________
leftCallout按钮。available=是;
}
if语句的计算结果为false!!试图理解为什么ButtonType被报告为2(如果事实是用类型2创建的)
应迈克的要求:
(gdb)p(int)[(uibutton*)control)buttonType]
1美元=0美元
2009年12月31日14:04:26.821 iparknow![4432:207]_________________
(gdb)P(int)[(uibutton*)控件)按钮类型]
< /代码>
好吧,这样做更有意义。现在的问题是,为什么按钮类型从2更改为0?它是用buttonType 2创建的,并不知何故更改为0。有什么想法吗??/P
屏幕截图显示调试器报告按钮类型为2,但控制台显示按钮类型为0。调试器和控制台中显示了相同的变量。知道这种不匹配是怎么发生的吗?
(gdb) po ((UIButton *)control).buttonType
没有名为ButtonType的成员。
按要求:
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;
}
if语句的计算结果为false!!试图理解为什么ButtonType被报告为2(如果事实是用类型2创建的)
应迈克的要求:
(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]
好吧,这样做更有意义。现在的问题是,为什么按钮类型从2更改为0?它是用buttonType 2创建的,并不知何故更改为0。有什么想法吗??