2014-11-23 236 views
0

我想將AMBubbleTableViewController模塊添加到我的應用程序(https://github.com/andreamazz/AMBubbleTableView),並且我按照說明操作,但出現很多錯誤,我不知道爲什麼。Xcode模塊導入錯誤

這些是錯誤,任何想法?

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

這是一個鏈接器錯誤,因爲符號和類定義未包含在正在編譯的任何源文件中。確保編譯源構建階段包含'AMBubbleTableViewController.m'和'AMBubbleGlobals.m'文件。 – warrenm 2014-11-24 00:11:00

+0

謝謝!問題已解決。我需要修復更多的東西,但它解決了問題。再次感謝! – 2014-11-24 11:29:39

+0

如果此評論有助於解決您的問題,請接受下面的答案。 – warrenm 2014-11-24 20:28:31

回答

1

你會經常看到這種鏈接錯誤的時候包含你正在使用沒有被編譯一個特定的定義源文件,儘管它們的聲明位於您正在導入的頭文件中。

您可以通過將相應的源文件添加到項目的「編譯源」構建階段來解決此問題。

在這種特殊情況下,您需要包含AMBubbleTableViewController.mAMBubbleGlobals.m文件。