我试图让数组的内容显示在 uitextfield 上。
这是我的代码:
NSArray *arrayConditions = [[NSArray alloc] initWithObjects:[item objectForKey:@"conditions"], nil];
NSString * resultConditions = [arrayConditions description];
//conditionsDeal 是 uitextfield self.conditionsDeal.text = resultConditions;
条件是从这样的 url 中提取的:
"results": [
{
"conditions": [
"Il coupon è valido per soggiorni fino al...",
"I coupon sono cumulabili, possibilità...",
"Coupon non cumulabile con altre promozioni...",
],
"deadline": "2013-11-27T22:59:59.000Z",
目前我的 uitextview 中唯一显示的是:
我需要删除 ( ( ) ) 括号并整齐地格式化它。
谢谢你的帮助
最佳答案
你想像这样连接数组中的所有字符串:
self.conditionsDeal.text = [arrayConditions[@"conditions"] componentsJoinedByString:@"\n"];
关于ios - 如何获取数组的内容以显示在 uitextfield 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14341256/