UIAlertViewボタンからpresentModalViewControllerを介してビューを呼び出そうとしています。コードは以下のとおりです。NSlogがコンソールに表示されるので、コードの実行が実際にそのポイントに到達していることがわかります。また、エラーや表示されるものはありません。
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != [alertView cancelButtonIndex])
{
NSLog(@" The username is: %@ AND the password is: %@ ",textField.text,passTextField.text);
// do some logic in here later
CompanyViewController *companyViewController = [[[CompanyViewController alloc] initWithNibName:@"CompanyViewController" bundle:nil] autorelease];
[self presentModalViewController:companyViewController animated:YES];
}
[textField resignFirstResponder];
[passTextField resignFirstResponder];
}
*****編集:上記のメソッドはUIViewControllerに属しています。以下はインターフェースファイルです。
@interface testingViewController : UIViewController <UITextFieldDelegate>
{
UITextField *textField;
UITextField *passTextField;
}
@property (nonatomic, retain) UITextField *textField;
@property (nonatomic, retain) UITextField *passTextField;
@property (readonly) NSString *enteredText;
@property (readonly) NSString *enteredPassword;
@end
どんな助けでも大歓迎です。