Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试删除 Mans CoreData 实体中的所有对象时出现此错误。
No visible @interface for 'CoreDataController' declares the selector 'deleteAllObjects:'
这是由于我在我的 CoreDataController 类中调用它而发生的。
[self deleteAllObjects:@"Mans"];
任何帮助将不胜感激。
您必须确保您的CoreDataController类提供了它实现的可见声明deleteAllObjects。在最新版本的 Xcode 中,同@implementation一块中的方法都应该对彼此可见。同样,在主 .m 文件中,有一个类扩展名;在那里声明的所有方法都将对文件中的方法可见。在旧版本的 Xcode 中,实现文件私有的任何方法也必须在那里声明。如果您的方法在类别中声明,则必须确保在引用之前导入类别标头。
CoreDataController
deleteAllObjects
@implementation