0

モーダルを表示する必要があるナビゲーション コントローラー内に ViewController があります。

ViewController のヘッダーは次のとおりです。

@interface ViewController : BaseViewController<AuthenticateDelegate>

そして、モーダルを提示する IBAction で:

 AuthenticationController *authVC = [self.storyboard instantiateViewControllerWithIdentifier:@"AuthControllerView"];
        authVC.delegate = self;
        [self presentModalViewController:authVC animated:YES];

AuthenticationController の .h ファイルには次のように記述されています。

@interface AuthenticationController: BaseViewController<UITextFieldDelegate>

@property (nonatomic, assign) id <AuthenticateDelegate> delegate;

@end

ご覧のとおり、AuthenticationController のデリゲートとして "self" (ViewController) を割り当てましたが、何らかの理由でデリゲートは次の場所にあります。

- (IBAction)SubmitAuthentication:(id)sender;
{
    [self.delegate validateUser:lblUsername.text :lblPassword.text];

    [self dismissModalViewControllerAnimated:YES];
}

どんな助けでも大歓迎です。

4

1 に答える 1

1

以下のようにデリゲートプロパティを作成する必要があります。

@property (nonatomic, strong) id <AuthenticateDelegate> delegate;
于 2012-11-01T12:48:41.873 に答える