I am using the following code to get network info about my iPhone -
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
CTTelephonyNetworkInfo *netInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [netInfo subscriberCellularProvider];
NSString *osVersion = [[UIDevice currentDevice] systemVersion];
But I get the error -
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
objc-class-ref in MyClass.o
ld: symbol(s) not found for architecture armv7
Isn't the class a part of the iOS SDK? What am I doing wrong?
It is part of the CoreTelephony.framework. You need to add that framework for your code to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With