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