NSMutableString没有得到追加

时间:2011-06-13 13:13:06

标签: iphone ios4

[string appendString:@""];
((appdelegete *)[UIApplication sharedApplication].delegate).salesReceipt.old = [string ];

我想在收集数据的NSMutableString字符串中添加所有元素。最好的方法是什么?在我的appdelegate课程中有一个NSMutableString,我将在其中存储NSMutableString

中的所有元素

1 个答案:

答案 0 :(得分:0)

NSMutabelString* string = [[NSMutabelString alloc] initWithCapacity:2]
[string appendString:@"My String "];
[string appendString:@""];
//Now you need to access your NSMutableArray from Delegate add add the string.
 NSMutableArray* myArray = ((appdelegete *)[UIApplication sharedApplication].delegate).salesReceipt.items ;
[myArray addObject:string];