我在理解链接器命令错误时遇到问题。我收到以下内容:
duplicate symbol _OBJC_IVAR_$_XYZAddToDoItemViewController._toDoItem in:
/Users/*/Library/Developer/Xcode/DerivedData/ToDoToday-fjyijxlbvauebmeuhtgdvdrjtfez/Build/Intermediates/ToDoToday.build/Debug-iphonesimulator/ToDoToday.build/Objects-normal/i386/XYZToDoListViewController.o
/Users/*/Library/Developer/Xcode/DerivedData/ToDoToday-fjyijxlbvauebmeuhtgdvdrjtfez/Build/Intermediates/ToDoToday.build/Debug-iphonesimulator/ToDoToday.build/Objects-normal/i386/XYZAddToDoItemViewController.o
duplicate symbol _OBJC_CLASS_$_XYZAddToDoItemViewController in:
/Users/*/Library/Developer/Xcode/DerivedData/ToDoToday-fjyijxlbvauebmeuhtgdvdrjtfez/Build/Intermediates/ToDoToday.build/Debug-iphonesimulator/ToDoToday.build/Objects-normal/i386/XYZToDoListViewController.o
/Users/*/Library/Developer/Xcode/DerivedData/ToDoToday-fjyijxlbvauebmeuhtgdvdrjtfez/Build/Intermediates/ToDoToday.build/Debug-iphonesimulator/ToDoToday.build/Objects-normal/i386/XYZAddToDoItemViewController.o
duplicate symbol _OBJC_METACLASS_$_XYZAddToDoItemViewController in:
/Users/*/Library/Developer/Xcode/DerivedData/ToDoToday-fjyijxlbvauebmeuhtgdvdrjtfez/Build/Intermediates/ToDoToday.build/Debug-iphonesimulator/ToDoToday.build/Objects-normal/i386/XYZToDoListViewController.o
/Users/*/Library/Developer/Xcode/DerivedData/ToDoToday-fjyijxlbvauebmeuhtgdvdrjtfez/Build/Intermediates/ToDoToday.build/Debug-iphonesimulator/ToDoToday.build/Objects-normal/i386/XYZAddToDoItemViewController.o
ld: 3 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我不确定 Xcode 到底指的是哪些符号。下面是实现文件的顶部。
XYZToDoListViewController.m:
#import "XYZAddToDoItemViewController.h"
@interface XYZAddToDoItemViewController ()
@property NSMutableArray *toDoItems;
@end
@implementation XYZAddToDoItemViewController
XYZAddToDoItemViewController.m:
#import "XYZAddToDoItemViewController.h"
@interface XYZAddToDoItemViewController ()
@property (weak, nonatomic) IBOutlet UITextField *textField;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *doneButton;
@end
@implementation XYZAddToDoItemViewController
任何帮助将不胜感激,谢谢。