報警告
category is implementing a method which will also be implemented by its primary clase
- 我在category中重寫了原類的方法 而蘋果的官方文檔中明確表示 我們不應該在category中復寫原類的方法,如果要重寫 請使用繼承 原文是這樣的:A category allows you to add new methods to an existing class. If you want to reimplement a method that already exists in the class, you typically create a subclass instead of a category.
解決方法
添加這兩句
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"