0
我想调试我的iPhone应用程序(一个基本的计数器),我有一个“goto”函数去特定的数字。在测试我的应用程序时,我注意到当设置goto而没有将任何东西放入NSTextField
时,它不会返回任何内容。不是NULL
,nil
,或任何东西。输入字符串甚至不会显示在控制台中。没有空白消息,没有NULL
消息,什么都没有。如果你想看到我的代码,这就是:来自textfield的NULL输入不会NSLog?
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
switch(buttonIndex) {
case 0:
break;
case 1:
NSLog(@"Method called");
NSLog(@"%@", [[alertView textField] text]);
if ([[alertView textField] text] != NULL) {
count = [[[alertView textField] text] intValue];
[label setText:[[alertView textField] text]];
} else {
break;
}
}
}
“方法被称为”总是显示出来,但下一行不上来根本上没有输入的情况下。
在此先感谢!
感谢您的答案,但它仍然记录为'Alertview textfield =' – esqew 2010-07-20 22:41:39
我已更新我的答案是否有帮助吗? – 2010-07-20 23:01:11
是!谢谢......我的确在工作时笑了。再次感谢!!!!我完全忘了'isEqualToString' ...噢! – esqew 2010-07-21 02:08:19