簡単な質問があります。本当に困っているので、助けてください。ログインとパスワードが空でない場合、ログインボタンが押された後に別のViewControllerに切り替える必要があります
ユーザー名、パスワード、ログインボタンを備えたシンプルなログインインターフェイスがあります。パスワードまたはログインが空の場合、UIAlertView が表示されます。コードは次のとおりです。
.m ファイル
- (IBAction)login:(id)sender {
if (userName.text.length == 0 || password.text.length == 0){
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Complete All Fields" message:@"You must complete all fields to login!" delegate:self cancelButtonTitle:@"Good" otherButtonTitles:nil, nil];
[alert show];
}
}
ボタンのアクションを追加して他のUIControllerに切り替える方法は? これは常にクラッシュしています[self presentModalViewController: anotherUIViewController animated YES];
ここにも通知があります-「アプリケーションはターゲットに nil modal View Controller を提示しようとしました。」