5

In the past i have done subclassing of UITableView and UICollectonView many times, in which i have assigned self to the delegate and datasource, and it worked fine.

Today i tried to make subclass of UITextField and in that I am assigning self to its delegate as

self.delegate = self

where delegate is inherited from UITextFiled. In above case this is hanging the App forever in iOS 7, but works for iOS 8. Another surprising thing is, when i try to input the text in it from Hardware keyboard then it works fine but it get hanged on typing characters from On-Screen keyboard.

What may be reason of this, Can any one help me to understand?

Noor
  • 2,071
  • 19
  • 28
Mrug
  • 4,963
  • 2
  • 31
  • 53
  • I would love to know if you discovered an answer to this, or even a work around. I am having a similar issue, and I see that no one helped you on this post. I am hoping you figured it out! Here is my issue: http://stackoverflow.com/questions/28241104/uitextfielddelegate-works-on-ios-8-but-not-ios-7 – zeeple Jan 30 '15 at 22:48

1 Answers1

0

I was having a similar issue and I figured it out. The simulator will not raise the keyboard by default anymore. If there is a hardware keyboard available and detectable (for example on a MacBook) the simulator will look for input from it and the simulated iPhone keyboard will not raise. This gives the appearance of a problem with the delegate. All you have to do is in the Simulator's Hardware menu, under Keyboard, unselect the option for "Connect Hardware Keyboard". I hope this helps.

zeeple
  • 5,509
  • 12
  • 43
  • 71