开发者

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]];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜