Xcode:找不到通过Pod添加的依赖项,获取未定义的符号

时间:2014-11-29 04:22:04

标签: ios iphone xcode cocoapods

我的Podfile

platform :ios, '7.0'
pod 'REFrostedViewController', '~> 2.4.7'
pod 'AFNetworking', '~> 2.4'
pod 'SWTableViewCell', '~> 0.3.6'

在我的TransactionViewController中,我在

中关注
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    // make last cell visible: http://stackoverflow.com/questions/11928085/uitableview-not-visible-the-last-cell-when-scroll-down
    tableView.contentInset = UIEdgeInsetsMake(0, 0, 120, 0);
    [tableView registerNib:[UINib nibWithNibName:@"TransactionCell" bundle:nil] forCellReuseIdentifier:CellIdentifier];

    TransactionCell *transactionCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    if (transactionCell == nil) {
        transactionCell = [[TransactionCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
    }

    transactionCell.rightUtilityButtons = self.rightButtonActions;
...
}

- (NSArray *)rightButtonActions {
    NSMutableArray *rightUtilityButtons = [NSMutableArray new];
    [rightUtilityButtons sw_addUtilityButtonWithColor:
                    [UIColor colorWithRed:0.78f green:0.78f blue:0.8f alpha:1.0]
                                                title:@"More"];
    [rightUtilityButtons sw_addUtilityButtonWithColor:
                    [UIColor colorWithRed:1.0f green:0.231f blue:0.188 alpha:1.0f]
                                                title:@"Delete"];

    return rightUtilityButtons;
}

这是来自github

的示例

当我运行我的应用程序时,Xcode失败并显示以下错误

ld: warning: directory not found for option '-L/Users/harith/code/XcodeProjects/pennyapp-ios/Pods/build/Debug-iphoneos'
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_SWTableViewCell", referenced from:
      _OBJC_CLASS_$_TransactionCell in TransactionCell.o
  "_OBJC_METACLASS_$_SWTableViewCell", referenced from:
      _OBJC_METACLASS_$_TransactionCell in TransactionCell.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我是iOS编程新手,不知道如何解决这个问题。

但我确实看到,对于Podfile中的其他两个依赖项,我在框架中有相应的*.a文件,但SWTableViewCell没有,问题是什么?

enter image description here

1 个答案:

答案 0 :(得分:1)

如果您查看构建日志,您将看到有关不构建库的警告,因为它缺少体系结构......

在每个pod构建设置中,将“Build Active Architectures Only”更改为NO,以用于所有设置(Debug / Dist / Release)。

enter image description here