美文网首页
警告⚠️:method '-top' in category f

警告⚠️:method '-top' in category f

作者: 可bing | 来源:发表于2020-12-07 11:58 被阅读0次

产生原因
最近项目突然出现了大量此类型警告,原因竟是Masonry里View+MASShorthandAdditions和NSArray+MASShorthandAdditions这两个类别把方法声明和实现都写在了.h文件里,在xcode11里这么写会造成项目中多个target或者framework库以及.a库引入 Masonry时产生大量”method conflicts with same method from another category“ 警告。

解决方案
把NSArray+MASShorthandAdditions.h和View+MASShorthandAdditions.h中的@implementation代码块移到新建的.m文件中。

相关文章

网友评论

      本文标题:警告⚠️:method '-top' in category f

      本文链接:https://www.haomeiwen.com/subject/utwzwktx.html