I need to pass a character to the line no. 2: First method I tried,
1) unichar dicttxt = [[myword lowercaseString] characterAtIndex:0];
2) fileName = [[NSBundle mainBundle] pathForResource:dicttxt ofType: @"txt"];
2nd Method I tried,
NSString *dicttxt = [[myword lowercaseString] characterAtIndex:0];
fileName = [[NSBundle mainBundle] pathForResource:dicttxt ofType: @"txt"];
Both method suggest error Make pointer from integer without a cast.
Rather than using a character, use:
Alternatively (and I forget about this method entirely), the following is functionally equivalent to the above, but more concise:
These will work as long as:
mywordhas a length of at least 1.myworddoes not start with composite characters (i.e. “café” is fine, but “über” might not be).