I want to ask a objective C question. I have a string retrieve from UITextField and I want to check the string contains the ‘@’ or not. However, when I use the following code, it has some errors, can anyone help me? Thank you.
if([inputTextField.text rangeOfString:@"%"].location != NSNotFound)
NSLog(@"It does not contain the %@");
else
NSLog(@"It contains the %@");
Check the syntax:
As you will see, the
%@will be replaced with the content ofmyString.