IOS 9 / Swift 2 input from numpad cannot find key block

I have a very simple code that reads text from a text field when the user clicks a button and updates the text on the shortcut. I have a type of input field installed on a digital panel.

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 run my action, xCode throws this error:

Unable to find a keyboard that supports Type 4 keyboard for iPhone-PortraitTruffle-digital keypad; using 675849259_PortraitTruffle_iPhone-Simple-Pad_Default

EDIT:

It turns out that this is not a mistake at all, but a simple logging instruction. I must have accidentally set a breakpoint in my action, giving it the look and loss of a crash. Thanks, first responder.

+4
source share
3

. . . .

+9

, xocode- Simulator, :

iOS Simulator → → →

+2

. , keyplane..

Screenshot

Hardware -> Keyboard -> Toggle Software Keyboard cmd + shift + k

Screenshot 1

: -)

0

Source: https://habr.com/ru/post/1610672/


All Articles