【发布时间】:2012-10-13 06:59:59
【问题描述】:
我需要在我的 iOS 应用程序中的多行 UITextView 中显示来自 JSON Webservice 的一些数据,但是当我在 textview 上使用字符串时,新行不起作用。
这是我正在使用的代码:
// Data Value from JSON = testing the data value \r\n Another \n liine maybe?
NSString *responseDataString = [dictRequestorDetails objectForKey:@"data"];
txtWorkflowDetails.text = responseDataString;
当我执行这段代码时,UITextField 会显示
测试数据值 \r\n 可能是另一个 \n 线?
但是,如果我输入类似的字符串
// Data Value from JSON = testing the data value \r\n Another \n liine maybe?
NSString *responseDataString = [dictRequestorDetails objectForKey:@"data"];
txtWorkflowDetails.text = @"testing the data value \r\n Another \n liine maybe?";
换行符然后在 TextView 中起作用
【问题讨论】:
标签: objective-c ios json uitextview