Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - _OBJC_CLASS_$_CTTelephonyNetworkInfo not found?

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?

like image 265
Suchi Avatar asked Nov 17 '11 16:11

Suchi


1 Answers

It is part of the CoreTelephony.framework. You need to add that framework for your code to work.

like image 140
Joe Avatar answered Oct 15 '22 10:10

Joe