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

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -