简体   繁体   中英

NSMutableString doesn't get append

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

I want to add all my elements in my NSMutableString string whose data are getting collected. What is the best way to do it?In my appdelegate class there is a NSMutableString in which I am going to store all the elements from the 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];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM