click here to see snapshot of error 这是我们尝试使用目标c在xcode中开发应用程序时得到的错误。由于我们不熟悉该技术,我们无法理解重复定义的发生位置。请帮助我们。
答案 0 :(得分:0)
如果你使用#include而不是import,那么使用这种技术来减少重复:在接口开始时(实际上在它之前)检查定义,如果没有定义,则定义它并继续定义你的接口。这是一个例子:
#ifndef __NetworkOptionsViewController__H // check if this has every been imported before
#define __NetworkOptionsViewController__H
#import "blahblah.h"
@interface NetworkOptionsViewController : UITableViewController
{
NSMutableArray* somevariable1;
int somevariable2;
}
@end
#endif
- 根据我之前遇到的特定问题,我收到此错误,因为我班级的文件路径错误。我检查了文件检查器,我的类文件路径还没有在IDE中的Classes文件夹中定义。我删除了它们并再次复制它们。