I am trying to verify that my uitextfield, which only allows numbers isn’t 0 (zero). This check fails every time? When debugging resultingString = ‘0’( I type in zero ) as I am trying to make it fail, but it doesn’t fail.
NSString *resultingString = budgetField.text;
if(resultingString == @"0" || [resultingString length] == 0){
[AppHelpers showAlert:@"Dude!" withMessage:@"Don't be cheap I know you have more than a $1"]; //never gets in here.
return;
}
Use “==” for values, not strings: