I have some very basic code which reads the text from a textfield when the user presses a button, and updates the text on a label. I have the type of the input field set to number pad.
import UIKit
class ViewController: UIViewController {
@IBOutlet var userGuessTextField: UITextField!
@IBOutlet var resultLabel: UILabel!
@IBAction func guess(sender: AnyObject) {
let randomNumber = String(arc4random_uniform(11))
if randomNumber == userGuessTextField.text {
resultLabel.text = "You're right"
} else {
resultLabel.text = "Wrong! It was a \(randomNumber)"
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
When I trigger my action, xCode throws this error:
Can't find keyplane that supports type 4 for keyboard iPhone-PortraitTruffle-NumberPad; using 675849259_PortraitTruffle_iPhone-Simple-Pad_Default
EDIT:
Turns out this is not an error at all, but a simple logging statement. I must have accidentally set a breakpoint in my action, giving it the look and feel of a crash. Thank you, first responder.
Laugh uncontrollably and just keep going. It's not an error. It's just a bit of fluff dropped into the console. Ignore it.
It can happened sometime when you update xocode testing on Simulator you can try this fix:
iOS Simulator -> Hardware -> Keyboard -> Connect Hardware Keyboard
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With