构建自己的iOS Framework获取未定义的符号构建错误

时间:2015-02-05 08:37:59

标签: ios frameworks build-error

我创建了自己的框架。

我有一个A类,它将导出到公共用途 在文件A.m中,我只添加一些简单的代码行

@interface A ()
{
    CTCallCenter* mCallCenter;
}
@end

@implementation A

- (instancetype)init {
    if (self = [super init]) {
        mCallCenter = [[CTCallCenter alloc] init];
    }
    return self;
}

- (void)dealloc {
    [super dealloc];
}

@end

我在.pch文件中添加了框架CoreTelephony

#import <CoreTelephony/CTCallCenter.h>

我的框架已成功构建为网站http://www.raywenderlich.com/65964/create-a-framework-for-ios

的指南

我检查我的框架胖文件,它包括4个切片:

Architectures in the fat file: <MyFramework> are: armv7 i386 x86_64 arm64 

但是当我将我的框架包含到项目测试中并使用A类时,会出现类似

的构建错误
**Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_CTCallCenter", referenced from:
      objc-class-ref in MyFramework(A.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)**

在项目测试文件ViewController.m中

#import "ViewController.h"
#import <MyFramework/A.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    A* ATest = [[A alloc] init];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

这是我的框架Build Settings

的屏幕截图

enter image description here

任何人都可以帮我找出我想念的东西

0 个答案:

没有答案