I would like to append the word "Completed" to the end of the self.myLabel.text, following the value returned from numberValue.
So, say numberValue returns 234, I would like self.myLabel.text to become "234 completed".
I am sure this is a simple task, but am missing the obvious?!
The code used to display the number only is:-
self.myLabel.text = [NSString stringWithFormat:@"%ld", numberValue];
self.myLabel.text = [NSString stringWithFormat:@"%d completed", numberValue];
If you are using NSNumber (or any similar object class such as NSString, NSDecimalNumber, NSDate), use the %@ format string.
So for your example: [NSString stringWithFormat:@"%@ completed", numberValue];
If you are using NSInteger, you can use the %d/%ld (long integer) formats.
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