Summarize the various pits for iOS 8 and Xcode 6

Source: Internet
Author: User

The path of the simulator moves from the previous ~/Library/Application Support/iPhone Simulator to ~/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 should be iPhone 4s 7.1 iPhone 4s 8.0 iPhone 5s 7.1 iPhone 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

self.tableView.rowHeight = 44.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{[Super Viewdidload]; Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (1.0 * nsec_per_sec)), Dispatch_get_main_queue (), ^{Self. Array = @[@ "Test"]; [Self. TableView Reloaddata]; });} - (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]; return cell;}               

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 in otherPCH File
* Found in Build settingsPrefix Header
* Add PCH file, the rule is: project name/xxxxx.pch

Uialertview's pit.

Uialertview long text problem with untitled

UIAlertView *alterView = [[UIAlertView alloc] initWithTitle:nil message:@"远端Git仓库和标准的Git仓库有如下差别:一个标准的Git仓库包括了源代码和历史信息记录。我们可以直接在这个基础上修改代码,因为它已经包含了一个工作副本。" delegate:self cancelButtonTitle:@"知道了" 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 = [[UIAlertView alloc] initWithTitle:@"" message:@"远端Git仓库和标准的Git仓库有如下差别:一个标准的Git仓库包括了源代码和历史信息记录。我们可以直接在这个基础上修改代码,因为它已经包含了一个工作副本。" delegate:self cancelButtonTitle:@"知道了" otherButtonTitles:nil, nil];[alterView show];

Summarize the various pits for iOS 8 and Xcode 6

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.