Reputation:
I have got an iPad app with this as part of my code:
if (NAME1.text == @"") {
SS1.text = @"";
SPA1.text = @"";
}
But it does not clear the UILabel
if there is nothing in a UITextField
!
Does anyone know how I can get it to do what I want?
Upvotes: 0
Views: 49
Reputation: 163228
Check the length
of the string, don't do direct pointer comparison:
if ([NAME1.text length] == 0) {
SS1.text = @"";
SPA1.text = @"";
}
Upvotes: 2