objective c - Get int value of UITextField -


i'm trying int value of uitextfield. have set keyboard type to:

textfield.keyboardtype = uikeyboardtypenumberpad; 

and try int value this:

nslog:([nsstring stringwithformat:@"%i", [textfield.text intvalue]]); 

even though enter integers returns 0. whats wrong?

my guess is, textfield nil. outlet set correctly? outlet property , access self.textfield.text.

you log textfield , see if nil.


Comments

Popular posts from this blog

Using 'OR' and 'AND' in SQL Server -

c++ - NetBeans Remote Development with additional configuration -

visual studio - TFS will not accept changes I've made to a Java project -