最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]swift代码出错:Cannot find protocol declaration for ‘NSObject’

iOS crifan 4346浏览 0评论

代码:

@protocol GesturePasswordDelegate <NSObject>

– (void)forget;

– (void)change;

@end

出错:

GesturePasswordView.h:9:36: Cannot find protocol declaration for ‘NSObject’

如图:

Cannot find protocol declaration for ‘NSObject’

ios – cannot find protocol declaration for NSObject – Stack Overflow

objective c – "Cannot find interface declaration for NSObject"? – Stack Overflow

iphone – Cannot find protocol declaration NSObject – Stack Overflow

加上导入foundation:

#import <Foundation/Foundation.h>

@protocol GesturePasswordDelegate <NSObject>

– (void)forget;

– (void)change;

@end

即可。

转载请注明:在路上 » [已解决]swift代码出错:Cannot find protocol declaration for ‘NSObject’

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
85 queries in 0.179 seconds, using 22.04MB memory