开发者社区 问答 正文

关于UITextField文本内容显示alert

有两个UITextField,我想要检测UITextField,当满足两个UITextField都有文本内容时,显示alert,如果只有一个UITextField有文本内容时向下一步进行。

展开
收起
爵霸 2016-03-17 10:57:55 1845 分享 版权
1 条回答
写回答
取消 提交回答
  • 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
       }
    
    2019-07-17 19:04:49
    赞同 展开评论
问答地址: