So, I want to put an instance variable into a NSString like this:
NSString *theAnswer = (@"The answer is %@\n", self.answer);
I'm not sure am I right or not. I thought that NSString would work like NSLog but apparently it doesn't.
theAnswer returns as only the instance variable without "The answer is"
Can someone tell me why and how to fix this problem?
Thanks.
NSString *theAnswer = [NSString stringWithFormat:@"The answer is %@", self.answer];
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