我将其中一个实例方法更改为一个类方法,以便可以从另一个类访问它。该方法调用成功,但我有我的代码,一个警告:类方法的不完整实现 - 缺少什么?
- 完全执行(就行了“@implementation myViewController”)
我的类代码如下所示:
//...
@implementation myViewController
#pragma mark - myMethod
+ (void)myMethod:(CustomUIView *)customView didSelectText:(NSString *)text
{
//...
}
//...
在我的类的头文件,我有以下几点:
#import "CustomUIView.h"
//...
@interface myViewController : CustomUIViewController <CustomUIViewDelegate>
{
//...
}
//...
@end
我想我必须在头文件的错误部分声明方法,可能是由于子句?或者我完全错过了其他的东西。我在网上看了一眼,并且as far as I can tell I'm following protocol;也许这有一些特殊的设置?
编辑:这是我的协议从我CustomUIView头文件:
@class CustomUIView;
@protocol CustomUIViewDelegate <NSObject>
+ (void)myMethod:(CustomUIView *)customView didSelectText:(NSString *)text;
//...
@end
你的协议在哪里? –
TSAlertView的实现在哪里? –
@HotLicks本来打算将其改为通用的'myMethod';希望这个问题现在更有意义。 – CaptainProg