Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 9/Swift 2 input from numpad can't find keyplane

Tags:

xcode

ios

swift

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.

like image 280
ThinkingInBits Avatar asked Oct 08 '15 01:10

ThinkingInBits


2 Answers

Laugh uncontrollably and just keep going. It's not an error. It's just a bit of fluff dropped into the console. Ignore it.

like image 86
matt Avatar answered Oct 22 '22 02:10

matt


It can happened sometime when you update xocode testing on Simulator you can try this fix:

iOS Simulator -> Hardware -> Keyboard -> Connect Hardware Keyboard

like image 2
Imran Avatar answered Oct 22 '22 02:10

Imran