iphone - Can't seem to read UITextField value correctly -


i trying verify uitextfield, allows numbers isn't 0 (zero). check fails every time? when debugging resultingstring = '0'( type in 0 ) trying make fail, doesn't fail.

nsstring *resultingstring = budgetfield.text;

if(resultingstring == @"0" || [resultingstring length] == 0){     [apphelpers showalert:@"dude!" withmessage:@"don't cheap know have more $1"]; //never gets in here.     return; } 

use "==" values, not strings:

 ([resultingstring intvalue] == 0 || [resultingstring length] == 0) 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -