我有一个我想在uitextview中拥有的数组。这是当前显示的方式。如何删除(())?

这是截图

这是我的代码:

NSArray *arrayConditions = [[NSArray alloc] initWithObjects:[item objectForKey:@"conditions"], nil];

NSString * resultConditions = [arrayConditions description];

self.conditionsDeal.text = resultConditions;

NSLog(@"conditions are %@", [item objectForKey:@"conditions"]);

谢谢你的帮助

最佳答案

NSArray *arrayConditions = [[NSArray alloc] initWithObjects:[item objectForKey:@"conditions"], nil];

// change this line only for the concatenation
NSString * resultConditions = [arrayConditions componentsJoinedByString:@"\n"];

self.conditionsDeal.text = resultConditions;

// this line always provides you the result of the '-description' method of the 'NSArray'
NSLog(@"conditions are %@", [item objectForKey:@"conditions"]);

关于ios - 如何在UITextView中显示NSArray,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14398522/

10-14 20:54