1:assertion Failure in Dequeuereusablecellwithidentifier:forindexpath:
Static @" Cell " *cell = [TableView dequeuereusablecellwithidentifier:cellidentifier Forindexpath:indexpath];
The above is under the IOS9 has been reported flash, and later changed to solve the following:
Static @" Cell " ; *cell = [TableView dequeuereusablecellwithidentifier:cellidentifier]; if (cell==nil) { = [[UITableViewCell Alloc]initwithstyle:uitableviewcellstylesubtitle Reuseidentifier:cellidentifier]; }
2:coretelephony frame is not a private library
The contents of the private framework are:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks/
It can be seen that the Coretelephony framework is within frameworks rather than privateframeworks, so it can be used with confidence. The reason why the Internet has said that Coretelephony is a private library, is because in iOS6 time is a private framework, and then the Apple to open;
3: How to get phone status
A: First to import the Coretelephony framework:
@import coretelephony;
B: Then declare a ctcallcenter variable:
{ ctcallcenter *center_; To avoid a variable declared for retain cycle, point to receive Call center object } @end
Then monitor the phone status:
-(void) Aboutcall{//Get phone access information Callcenter.calleventhandler = ^ (Ctcall *call) {if ([Call.callstate isequaltostring:ctcallstatedisconnected]) {NSLog (@ "Call has been disconnected"); }else if ([Call.callstate isequaltostring:ctcallstateconnected]){NSLog (@ "Call has just been connected"); }else if ([Call.callstate isequaltostring:ctcallstateincoming]){NSLog (@ "Call is incoming"); }else if ([Call.callstate isequaltostring:ctcallstatedialing]){NSLog (@ "call is dialing"); }Else{NSLog (@ "Nothing was done"); }};}
You can also obtain carrier information:
-(void) Getcarrierinfo {//Get carrier information cttelephonynetworkinfo *info = [[Cttelephonynetworkinfo alloc] init]; Ctcarrier *carrier = Info.subscribercellularprovider; NSLog (@ "Carrier:%@", [carrier description]); //If carrier changes will update carrier output Info.subscribercellularproviderdidupdatenotifier = ^ (Ctcarrier *carrier) { NSLog (@ " Carrier:%@ ", [carrier description]);} ///Output phone data business information NSLog (@ "Radio Access technology:%@", info.currentradioaccesstechnology);}
Of course this is done in the real machine test, the following is the output information:
{Carrier name: [China Mobile]mobile Country Code: [460]mobile Network code:[07]iso country code:[cn]allows VOIP? [YES]} 2015-12-29 16:34:14.526 rwblemanagerdemo[1489:543655] Radio Access TECHNOLOGY:CTRADIOACCESSTECHNOLOGYHSDPA
iOS Development Basics-Fragmentation 48