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
Post a Comment