0

On iOS6 this cod works (myTextView is an instance variable):

myTextView = [[UITextView alloc] initWithFrame:CGRectMake(10, 10, 10, 10)];
myTextView.keyboardType = UIKeyboardTypeDefault;
[self addSubview:myTextView];

And on iOS5 it crashes on line:

[myTextView becomeFirstResponder];

But the strangest thing it that situation is: if i set keyboardType to UIKeyboardTypeEmail - no crashes!

Any ideas?

4

1 回答 1

1

切勿在主线程以外的线程上调用 UIKit 方法。如果它有效,那只是运气。

并且,下次您提出问题时,请务必在您的实际问题中提供更多详细信息,这样人们就不必通过评论来找到实际问题。

于 2013-03-05T19:14:14.780 回答