MissingMethodException: System.Int32.ToInt

Im trying to convert String to Int, so i can use the value in a TextField(requires String), and then converting so it will work out with:
for (var y = -lysize.ToInt(); y < ysize.ToInt(); ++y)

here ysize and -lysize are Strings, which im trying to convert to Int, its succefull, because i can actually edit the value in a TextField

wich requires an Int, the log doesnt give me any compiler errors, but when i click the GUI.Button that executes that line, it gives me this error
MissingMethodException: System.Int32.ToInt

Any help?

There is no “ToInt” function. You can use parseInt, or System.Convert.ToInt32, or Int32.TryParse. Put “#pragma strict” at the top of all your scripts so that you get errors at compile time, instead of when running them.