2

I have a array that's I want to have in a uitextview. This is how it's currently displaying. How do I remove the ( ( ) )'s?

Here's a screenshot

enter image description here

Here's my code:

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

NSString * resultConditions = [arrayConditions description];

self.conditionsDeal.text = resultConditions;

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

thanks for any help

4

3 に答える 3

3
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"]);
于 2013-01-18T13:07:02.300 に答える
2
NSMutableString *textViewText = [NSMutableString string];

for (NSString *str in arrayConditions)
    [textViewText appendFormat:@"%@\n", str];
self.conditionsDeal.text = textViewText;
于 2013-01-18T12:09:24.210 に答える
0
  1. その配列をNSMutableStringに変換します。
  2. その文字列を「、」またはスペースで区切り、UITextViewと記述します。
于 2013-01-18T12:20:01.200 に答える