This is my main:
int x=0;
NSString *new=[[NSString alloc]initWithString:@"9+4"];
x=[new intValue];
NSLog(@"hi %i",x);
This results in 9.. .since giving the intValue of a string will read only numbers and stops when the character is not a digit.
So how can i print the result of my string and get a 13 instead??
Change this line
NSString *new=[[NSString alloc]initWithString:@"9+4"];
to
NSString *new=[NSString stringWithFormat:@"%f",9+4];