简体   繁体   English

____的可见@interface没有声明选择器

[英]No visible @interface for ____ declares the selector

I have set up a method in a separate class (called ExternalClass) that needs to take two arguments. 我在一个单独的类(称为ExternalClass)中设置了一个方法,该方法需要两个参数。

-(void) openImage:(NSDictionary *)payload InApp:(UIApplication *)app;

In my AppDelegate.m, I call the method like this: 在我的AppDelegate.m中,我这样调用方法:

 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)payload fetchCompletionHandler (void (^)(UIBackgroundFetchResult))completionHandler
    {
        [[ExternalClass sharedInstance] openImage:payload InApp:application];
    }

I am getting "No visible @interface for ExternalClass declares the selector 'openImage:InApp' 我收到“ ExternalClass没有可见的@interface声明选择器'openImage:InApp'

Any idea why? 知道为什么吗?

I think you forgot to declare this method in header(.h) file. 我认为您忘了在header.h文件中声明此方法。

Declare this method in ExternalClass.h file. ExternalClass.h文件中声明此方法。

-(void) openImage:(NSDictionary *)payload InApp:(UIApplication *)app;

And import this ExternalClass.h , where you want to use this method. 并在要使用此方法的位置导入此ExternalClass.h

Okay, I'm trying to create a framework and use it in my app. 好的,我正在尝试创建一个框架并在我的应用程序中使用它。 It turns out none of the changes I made to any my framework methods were being reflected in my app. 事实证明,我对任何框架方法所做的更改都没有反映在我的应用程序中。 Thank you guys for pointing me in the right direction. 谢谢你们指出正确的方向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM