Try:
NSString *myString = [NSNumber stringValue];
You can do it with:
NSNumber *myNumber = @15;
NSString *myNumberInString = [myNumber stringValue];
//An example of implementation :
// we set the score of one player to a value
[Game getCurrent].scorePlayer1 = [NSNumber numberWithInteger:1];
// We copy the value in a NSNumber
NSNumber *aNumber = [Game getCurrent].scorePlayer1;
// Conversion of the NSNumber aNumber to a String with stringValue
NSString *StringScorePlayer1 = [aNumber stringValue];
or try NSString *string = [NSString stringWithFormat:@"%d", [NSNumber intValue], nil];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With