[英]Putting the text of a UITextField into a UIAlertView
我正在嘗試將文本字段中的文本放入UIAlertView中,但未顯示。 它只是顯示空白。
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Kik" message:self.kik.text delegate:self cancelButtonTitle:@"Got it!" otherButtonTitles: nil];
[alert show];
你應該試試,
if ( [self.kik.text length])
{
UIAlertView *alert = [UIAlertView alloc]initWithTitle:@"Kik" message:[NSString stringWithFormat:@"%@",self.kik.text] delegate:self cancelButtonTitle:@"Got it!" otherButtonTitles: nil];
[alert show];
}
else
{
UIAlertView *alert = [UIAlertView alloc]initWithTitle:@"Kik" message:@"Please enter a valid string" delegate:self cancelButtonTitle:@"Got it!" otherButtonTitles: nil];
[alert show];
}
校驗..
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.