Converting Str to Integer

Trying to learn iOS. I have spent over an hour fitzing with this simple operation. In desktop, what I want to do is simply…

dim myInt As integer = Val(answerFld.Text)

I finally found Integer.FromText
but when I do

myInt = Integer.FromText(answerFld.Text)

I get a “invalidargumentexception”
If I use a literal…

myInt = Integer.FromText("6")

it works. How do I get the value of the answerFld.Text?

You are likely getting the exception because answerFld.Text is blank. Instead try this:

If Not answerFld.Text.Empty Then myInt = Integer.FromText(answerFld.Text) Else myInt = 0 // Of whatever you want as the default End If

Thanks, Paul.
I had tried If answerFld.Text <> "" but I guess that has changed too.