Okay, so I’m trying to make this action change a user-editable textfield if the textfield is empty. This is the code i’m using right now, but it won’t work:
if ([textField.text isEqualToString:[NSString stringWithFormat:@""]]) {
[o1 setText:[NSString stringWithFormat:@"1"]];
Anybody know why? I did this as well:
UITextField *textField;
Is that necessary?
UPDATE:
I just realized I should have put this in here earlier, but it’s for ios, not mac. Sorry!
Your code is somewhat convoluted – just test like so:
You need to declare myTextField in the interface like so:
then link it in IB. You could make it a property to simplify memory management.