从头开始初始化后尝试调用VC方法(Obj-C)

时间:2017-02-21 13:01:41

标签: objective-c uiviewcontroller

我正在从故事板中初始化VC,如下所示:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
EstablishCallViewController *establishCallViewController = [storyboard instantiateViewControllerWithIdentifier:@"EstablishCallViewController"];
[[UIApplication sharedApplication].keyWindow setRootViewController:establishCallViewController];

我将VC establishViewController设置为我的rootViewController,然后我想像这样调用方法establishVoipCallAndShowCallViewController()

[establishCallViewController establishVoipCallAndShowCallViewController:EKandyOutgingVoIPCallOptions_startCallWithVideo];

然而,这会返回

  

没有可见的@interface用于' EstablishViewCallController'声明选择器' establishVoipCallAndShowCallViewController:'

嗯,不公平!在我的establishViewCallController.h文件中,我有:

@interface EstablishCallViewController : UIViewController
  -(void)establishVoipCallAndShowCallViewController:(enum EKandyOutgingVoIPCallOptions)outgoingCallOption;
@end

那么为什么它没有检测到这个实例方法呢?或者更好的是,我如何正确调用此实例方法?

该方法(已截断)我试图致电

-(void)establishVoipCallAndShowCallViewController:(EKandyOutgingVoIPCallOptions)outgoingCallOption
  {
    ...

1 个答案:

答案 0 :(得分:1)

似乎你忘记了.h文件中的establishVoipCallAndShowCallViewController的参数