如何获取数组的内容以显示在 uitextfield 上 [英] How to get the contents of an array to display on a uitextfield
本文介绍了如何获取数组的内容以显示在 uitextfield 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试让数组的内容显示在 uitextfield 上.
I'm trying to get the contents of an array to display on a uitextfield.
这是我的代码:
NSArray *arrayConditions = [[NSArray alloc] initWithObjects:[item objectForKey:@"conditions"], nil];
NSString * resultConditions = [arrayConditions description];
//conditionsDeal 是 uitextfieldself.conditionsDeal.text = resultConditions;
// conditionsDeal is the uitextfield self.conditionsDeal.text = resultConditions;
正在从这样的网址中提取条件:
conditions are being pulled from a url like this:
"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 中显示的唯一内容是:
Currently the only thing that displays in my uitextview is:
我需要删除 ( ( ) ) 括号并整齐地格式化.
I need to remove the ( ( ) ) parentheses and format it neatly.
感谢您的帮助
推荐答案
你想像这样连接数组中的所有字符串:
You want to join all the strings in the array like this:
self.conditionsDeal.text = [arrayConditions[@"conditions"] componentsJoinedByString:@"\n"];
这篇关于如何获取数组的内容以显示在 uitextfield 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文