How can I convert NSString to char? Note - char not const char. I have float number, I need to convert it so that only 2 values after . would be left. So I use NSString to do that. After that I need to make NSNumber from that. So I decided to convert NSString to char and after that to NSNumber. So I tried
char* someCharINeed = [SomeString UTF8String];
And it says
Cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'
If it is used like that
const char* someCharINeed = [SomeString UTF8String];
it works but NSNumber
[NSNumber numberWithChar:someCharINeed];
says
Cannot initialize a parameter of type 'char' with an lvalue of type 'const char *'