iOS Development Basics-Fragmentation 48

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.