IOS9 BUG: A bug that is very prone to crashes

Source: Internet
Author: User

Apple IOS9 has been introduced for some time, originally thought should be very stable, but the fact is not so. Debugging a very good app on iOS 8 on an iOS 9.1 device one day has found a wonderful problem: You can't release the keyboard.

Trace debugging, discovering that the program crashes as long as the code is running to a resignfirstresponder (or endediting) method call. There is a God-general bad exec error.

Comment on this code, everything OK, but you can't put away the soft keyboard.

There are countless answers on the web, and only one answer is reliable:

Http://www.dahuatu.com/1LypEbbMmn.html

Next, let's demonstrate this bug, and you'll see that it's so easy to crash a normal app on iOS 8.

New project. Drag a TextField and button on the view controller. Create a Ibaction connection for the button:

-(Ibaction) FREEKB: (ID) Sender {

[Self.view Endediting:yes];

}

No other code should write anything. Run the program (on iOS 9.1 emulator or device), click TextField, Keyboard popup, click button, the keyboard is closed. Everything OK, no problem.

Now let's see how to kill it. Implement a category, whatever you call it (e.g. test):

@implementation Uiviewcontroller (Test)

-(void) dealloc{

}

@end

As you can see, only an empty Dealloc method is defined, and no code is written in the method.

Run the program (on iOS 9.1 emulator or device), click TextField, Keyboard popup, click button, the keyboard is closed. Program Crashes! Delete Dealloc method, run again, everything is OK.

Ok, demo finished, thank you!

IOS9 BUG: A bug that is very prone to crashes

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.