0

I have a problem when I try call a UiViewController from another UiViewController on InputView. For example:

I have class main:

    class HomeViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, RunKeyboardDelegate
{
    override func viewDidLoad() {
        super.viewDidLoad()
        let view1 = self.storyboard!.instantiateViewControllerWithIdentifier("RunKeyboardViewController") as! RunKeyboardViewController
        view1.delegate = self

       txtRunPaciente.inputView = view1.view
}
}

class for inputView:

protocol RunKeyboardDelegate:class
{
    func runChange(sRun: String?)
}

class RunKeyboardViewController: UIViewController {

weak var delegate : RunKeyboardDelegate?
var sRun: String = ""
override func viewDidLoad()
{
    super.viewDidLoad()
    println("TECLADO INI")
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()

}
@IBAction func buttonAction(sender: UIButton)
{
 /*   sRun = sRun + "1"
    self.delegate?.runChange(sRun)
    */
    if(sender.tag == 1)
    {
        println("BTN1")
    }

}
@IBAction func btn2Action(sender: AnyObject)
{
    /*
     sRun = sRun + "2"
     self.delegate?.runChange(sRun)
    */
     println("BTN1")
}

}

When I link the storyboard button with the action, on clicked, the app crash and return this message: unrecognized selector sent to instance 0x7fe82d14d5f0.

Ciaran Donoghue
  • 800
  • 3
  • 22
  • 46
  • yo have not added(connected) the action to button properly.Delete the button and again add the button. – user3182143 May 07 '15 at 13:47
  • That's not the problem, eh aggregate and eliminate ation repeatedly without solution. The problem is that when I inputview class for reference only view and not the methods. Therefore the click of the button is pointing to a function that does not exist. – user1585195 May 07 '15 at 14:52
  • Ok. Now has been it solved? – user3182143 May 08 '15 at 07:21

0 Answers0