public void pressEvaluateButton(id sender) { try { var eval = new Evaluator(); edValue.text = "" + eval.Evaluate(edValue.text); } catch (EvaluatorError e) { var alert = UIAlertController.alertControllerWithTitle("Calculator!") message("Error evaluation: " + e.reason) preferredStyle(UIAlertControllerStyle.Alert); presentViewController(alert) animated(true) completion(null); } }