Thursday, 3 October 2013

iOS expected a expression

iOS expected a expression

This is likely not the hardest problem tackled on Stackoverflow, but I
can't seem to figure it out...
I got a switch statement and in this switch statement I want a local
variable which represent the text field. So I can set it secure. This is
the code I use for that:
[(UITextField * )[cell.contentView viewWithTag:TABLE_TEXT_FIELD_TAG]
setSecureTextEntry:YES]; // Works
Now I want to set more properties, hence the need (not really need but
good coding principle) of the local variable. I use this:
case 1:
UITextField *textFieldPassword = (UITextField *)[cell.contentView
viewWithTag:TABLE_TEXT_FIELD_TAG];
// Error I get: Expected expression
break;
Why does the compiler complains about this?

No comments:

Post a Comment