简体   繁体   English

没有可见的@interface声明选择器'deleteAllObjects'

[英]No Visible @interface declares the selector 'deleteAllObjects'

I am getting this error when I try to delete all of the objects in my Mans CoreData Entity. 当我尝试删除Mans CoreData实体中的所有对象时,出现此错误。

No visible @interface for 'CoreDataController' declares the selector 'deleteAllObjects:'

It is happening as a result of me calling this inside my CoreDataController class. 这是由于我在CoreDataController类中调用此函数而发生的。

[self deleteAllObjects:@"Mans"];

Any help would be greatly appreciated. 任何帮助将不胜感激。

You must make sure your CoreDataController class provides a visible declaration that it implements deleteAllObjects . 您必须确保CoreDataController类提供了一个可见的声明,该类实现了deleteAllObjects In the latest versions of Xcode, methods in the same @implementation block should all be visible to each other. 在最新版本的Xcode中,同一@implementation块中的方法应该对彼此都是可见的。 Likewise, within the main .m file, there is a class extension; 同样,在主.m文件中,有一个类扩展名。 all methods declared there will be visible to methods within the file. 文件中声明的所有方法对文件中的方法都是可见的。 In older versions of Xcode any method private to the implementation file had to be declared there as well. 在旧版本的Xcode中,还必须在其中声明实现文件专用的任何方法。 If your method is declared in a category, you must make sure to import the category header before referencing it. 如果您的方法是在类别中声明的,则必须确保在引用它之前导入类别标题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM