trying to add a reassignment to append the special newline character to a string in Obj C
I'm new to C and need to solve what I'm sure is a very simple problem. How do I add a reassignment to append for a newline in Objective C. The hint given was append @"\n". I want my output to appear on a new line. My code is below:
- (IBAction)displaySomeText: (id)sender
{
WonderfulNumber *myWonderfulNumber = [WonderfulNumber wonderfulNu开发者_StackOverflow社区mberWithFloat:pi];
NSString *stringToOutput = @"The value is: ";
stringToOutput = [stringToOutput stringByAppendingString:[myWonderfulNumber storedNumberAsString]];
[textView insertText:stringToOutput];
}
Please help
stringToOutput = [stringToOutput stringByAppendingFormat: @"\n%@",[myWonderfulNumber storedNumberAsString]];
精彩评论