问题描述
[string appendString:@\"\"];
((appdelegete *)[UIApplication sharedApplication].delegate).salesReceipt.old = [string ];
我想将我所有的元素添加到要收集其数据的NSMutableString
字符串中。最好的方法是什么?在我的appdelegate类中有一个NSMutableString
,我将在其中存储NSMutableString
中的所有元素
解决方法
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];