我需要在我的應用程序的輸入提示,我已經試過這UIAlertView中輸入提示
// Create a new item
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"New item" message:@"Enter a name for the item" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Add", nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert show];
再經手這樣說:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
// The user created a new item, add it
if (buttonIndex == 1) {
// Get the input text
NSString *newItem = [[alertView textFieldAtIndex:0] text];
}
}
,但它並不像在clickedButtonAtIndex被調用,爲什麼?
親切的問候, 埃裏克
爲什麼c#標記? – vikingosegundo
哦,哈哈 - 對不起。我很習慣在開發windows phone時問這個問題,因爲這只是一個老習慣 – Erik
哦。真的有必要一直倒下來嗎?現在我不能問問題了...我在問,因爲我自己還沒有找到解決方案 – Erik