我试图将AMBubbleTableViewController模块添加到我的应用程序(https://github.com/andreamazz/AMBubbleTableView),然后我按照说明操作,但是我遇到了很多错误而且我不知道原因。
这些是错误,有什么想法吗?
Undefined symbols for architecture x86_64:
"_AMOptionsBubbleDetectionType", referenced from:
-[Chat viewDidLoad] in Chat.o
"_AMOptionsBubblePressEnabled", referenced from:
-[Chat viewDidLoad] in Chat.o
"_AMOptionsBubbleSwipeEnabled", referenced from:
-[Chat viewDidLoad] in Chat.o
"_OBJC_CLASS_$_AMBubbleTableViewController", referenced from:
_OBJC_CLASS_$_Chat in Chat.o
"_OBJC_METACLASS_$_AMBubbleTableViewController", referenced from:
_OBJC_METACLASS_$_Chat in Chat.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
并且有我的代码:
- (void)viewDidLoad {
// Bubble Table setup
[self setDataSource:self]; // Weird, uh?
[self setDelegate:self];
[self setTitle:@"Chat"];
// Dummy data
self.data = [[NSMutableArray alloc] initWithArray:@[
@{
@"text": @"He felt that his whole life was some kind of dream and he sometimes wondered whose it was and whether they were enjoying it.",
@"date": [NSDate date],
@"type": @(AMBubbleCellReceived),
@"username": @"Stevie",
@"color": [UIColor redColor]
},
@{
@"text": @"My dad isn’t famous. My dad plays jazz. You can’t get famous playing jazz",
@"date": [NSDate date],
@"type": @(AMBubbleCellSent)
},
@{
@"date": [NSDate date],
@"type": @(AMBubbleCellTimestamp)
},
@{
@"text": @"I'd far rather be happy than right any day.",
@"date": [NSDate date],
@"type": @(AMBubbleCellReceived),
@"username": @"John",
@"color": [UIColor orangeColor]
},
@{
@"text": @"The only reason for walking into the jaws of Death is so's you can steal His gold teeth.",
@"date": [NSDate date],
@"type": @(AMBubbleCellSent)
},
@{
@"text": @"The gods had a habit of going round to atheists' houses and smashing their windows.",
@"date": [NSDate date],
@"type": @(AMBubbleCellReceived),
@"username": @"Jimi",
@"color": [UIColor blueColor]
},
@{
@"text": @"you are lucky. Your friend is going to meet Bel-Shamharoth. You will only die.",
@"date": [NSDate date],
@"type": @(AMBubbleCellSent)
},
@{
@"text": @"Guess the quotes!",
@"date": [NSDate date],
@"type": @(AMBubbleCellSent)
},
]
];
// Set a style
[self setTableStyle:AMBubbleTableStyleFlat];
[self setBubbleTableOptions:@{AMOptionsBubbleDetectionType: @(UIDataDetectorTypeAll),
AMOptionsBubblePressEnabled: @NO,
AMOptionsBubbleSwipeEnabled: @NO}];
// Call super after setting up the options
[super viewDidLoad];
[self.tableView setContentInset:UIEdgeInsetsMake(64, 0, 0, 0)];
}
答案 0 :(得分:1)
当包含您正在使用的特定定义的源文件未被编译时,您将经常看到此类链接器错误,尽管它们的声明位于您要导入的头文件中。
您可以通过将相应的源文件添加到"编译源"来解决此问题。构建项目的阶段。
在这种特殊情况下,您需要包含AMBubbleTableViewController.m
和AMBubbleGlobals.m
个文件。