I create my own framework.
I have a class A which will be export to public usage In file A.m, I just add some simple lines of code
@interface A ()
{
CTCallCenter* mCallCenter;
}
@end
@implementation A
- (instancetype)init {
if (self = [super init]) {
mCallCenter = [[CTCallCenter alloc] init];
}
return self;
}
- (void)dealloc {
[super dealloc];
}
@end
I added framework CoreTelephony in my .pch file
#import <CoreTelephony/CTCallCenter.h>
My framework is built successfully as guide from site http://www.raywenderlich.com/65964/create-a-framework-for-ios
I check my framework fat file, it includes 4 slices:
Architectures in the fat file: <MyFramework> are: armv7 i386 x86_64 arm64
But when I include my framework to project test and use class A. It gets build error like
**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)**
In file ViewController.m in project test
#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
This is a screenshot of my framework Build Settings
Can anyone help me figure out what I miss