有两个UITextField,我想要检测UITextField,当满足两个UITextField都有文本内容时,显示alert,如果只有一个UITextField有文本内容时向下一步进行。
2条回答 默认 最新
- abcdeFGh_xyz 2013-08-22 08:56关注
if([txt1.text length] > 0 && [txt2.text length]>0) { UIAlertView * alert=[ [UIAlertView alloc]initWithTitle:@"Alert" message:@"TextFied Have an Text" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil, nil]; [alert show]; } else { //Go Forword }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报