Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error appears when I type on UITextfield with physical keyboard in iOS7

Recently I upgrade my Xcode to Xcode5...

Sometimes running my app on my iPhone/iPad Simulator when I try to write on any UITextfield of my app (with my physical keyboard) this error appears on my Xcode5 ouptut window:

<Error>: CGContextSetBlendMode: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

if I use the keyboard of the simulator (screen), it works fine, but for testing purposes I'd rather typing on my Mac's Keyboard for quick development/testing, any ideas how to fix this???

thanks in advance

like image 918
Jesús Ayala Avatar asked Oct 09 '13 15:10

Jesús Ayala


2 Answers

This issue happened to me also when I moved to iOS 7.0. I've noticed that in the case of UITextfields, this issue occurs only with the empty text fields, especially on double clicking it. So I just done the following to remove the error:

myTextField.text = @" "; // Just replaced the textfield text with a 'space' on init
like image 162
Krishna Raj Salim Avatar answered Sep 27 '22 21:09

Krishna Raj Salim


I found a work around if you are still getting this error and you are using xib and/or storyboards. You can stop the error from occurring by setting 'capitalization' to 'none' and 'correction' to 'No' on the properties tab for the textbox. You maybe able to use one or the other but once I changed both properties the error went away.

like image 40
forbra Avatar answered Sep 27 '22 23:09

forbra