I have what I hope to be a pretty simple problem. I'm very simply trying to convert a char to it's lowercase version. Here's my code:
- (IBAction)click:(id)sender {
[outputLabel setText:[inputField text]];
NSString* textFieldString = [inputField text];
NSLog(@"String is %@", textFieldString);
int textFieldLength = textFieldString.length;
UniChar* currChar = [textFieldString characterAtIndex:0];
NSLog(@"First char is %c", currChar);
NSLog(@"Length is %i", textFieldLength);
//currChar = [currChar lowercaseString];
//NSLog(@"Lowercase char is %c", currChar);
}
It's giving me a the following error:
Initialization makes pointer from integer without a cast on the line:
NSString* currChar = [textFieldString characterAtIndex:0];
However, when looking in the documentation, it says that the method characterAtIndex:
returns a char, not an integer. What gives?