Summary of changes to IOS 8 and Xcode6

Source: Internet
Author: User

Today, when it comes to solving problems for a friend, there are many differences between iOS 8 and Xcode6 and the previous version, the current summary of the Great God is as follows:


Http://www.cocoachina.com/ios/20141218/10681.html

Project Path Pit

The path of the emulator from the previous~/Library/Application Support/iPhone SimulatorMoved to the~/Library/Developer/CoreSimulator/Devices/This pretty pit daddy, before running with which simulator directly select this emulator folder to go in to find the project
Now, the devices directory does not indicate the version of the simulator, the image of the corresponding may be selected on the iphone 5s 7.1
Then the folder on the picture corresponds to theiPhone 4s 7.1iPhone 4s 8.0iPhone 5s 7.1iPhone 5s 8.0..., but I don't know which one corresponds, okay, I'm going crazy.

Nsuserdefaults Pit

NSUserDefaultsI try to delete the iphone 4s, iphone 5s ... by storing the data locally, after the emulator has deleted the app, clean it, and can't erase the data. The same project inside, or no solution, this should be a bug, and so on Apple update Xcode (I currently use 6.0). But there's no such thing as a real machine (it must be)

UITableView Pit

Interface with UITableView if the following warning is encountered

Warning once only:detected a case where constraints ambiguously suggest a height of zero for a tableview cell ' s content V Iew. We ' re considering the collapse unintentional and using standard height instead.

Add the following code to resolve

self44.0f;
AutoLayout Pit

A typical uitabbarcontroller as the root view, and then click on one of the page buttons to push to a list page case, structure as
If you need to hide Tabbar on the list page, I will generally set the Bottombar to none in this VC so as to better constrain the layout, but ... When debugging, you will find a Tabbar height view at the bottom of the moment you enter the list page. Or just be honest with the default inferred.

The keyboard can't bounce.

Deselect Connect Hardware Keyboard

Detailtextlabel cannot be displayed

Let's start with the following code.

- (void) viewdidload{[SuperViewdidload]; Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (1.0* nsec_per_sec)), Dispatch_get_main_queue (), ^{ Self. Array= @[@ "Test"]; [ Self. TableViewReloaddata]; });} - (Nsinteger) TableView: (UITableView*) TableView numberofrowsinsection: (Nsinteger) section{return 1;} - (Nsinteger) Numberofsectionsintableview: (UITableView*) tableview{return 1;} - (UITableViewCell*) TableView: (UITableView*) TableView Cellforrowatindexpath: (Nsindexpath*) indexpath{UITableViewCell*cell = [TableView dequeuereusablecellwithidentifier:@ "Traderecordcell"Forindexpath:indexpath]; Cell. Detailtextlabel. Text= _array[indexpath. Row];returnCell;}

No problem with the code, in iOS 7, a second after the cell's Detailtextlabel will display 测试 two words, but in iOS 8 but not detailtextlabel display empty. The test found that when the text of Detailtextlabel starts empty, IOS 8 will set the size of the label (0, 0) so that it does not display correctly because the data is cell.detailTextLabel.text = _array[indexPath.row]; empty at the beginning, and the workaround:

If it's empty, don't set the value.

    if (_array[indexPath.row]) {        cell.detailTextLabel.text = _array[indexPath.row];    }

Or

cell.detailTextLabel.text = _array[indexPath.row] ? : @" ";
PCH file is missing.

Now the project created by Xcode 6 is not with the PCH file by default, and of course the older version of the project is preserved. So how do I add a PCH file?
* Command + N then select pch File
* found settings prefix Header
* add PCH file, rule is:   Project name/ XXXXX.PCH

Uialertview's pit.

Uialertview long text problem with untitled

Uialertview*alterview = [[UialertviewAllocInitwithtitle:Nil message:@"The remote Git repository and the standard Git repository have the following differences: A standard git repository includes source code and historical information records. We can modify the code directly on this basis, because it already contains a working copy. " Delegate: Self Cancelbuttontitle:@"I know." Otherbuttontitles:Nil,Nil]; [Alterview show];

The above code looks like this in iOS 8, the content is completely top to the top, the text is also inexplicably bold
I'm going to tell you, just set the title @"" on it, okay?

 Uialertview*alterview = [[UialertviewAllocInitwithtitle:@"" message:@"The remote Git repository and the standard Git repository have the following differences: A standard git repository includes source code and historical information records. We can modify the code directly on this basis, because it already contains a working copy. " Delegate: Self Cancelbuttontitle:@"I know." Otherbuttontitles:Nil,Nil]; [Alterview show];

Summary of changes to IOS 8 and Xcode6

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.