不知道怎么使用NSMutableArray
和NSArray
。
代码:
for (int i=0; i<[DateSortArry2 count]; i++) {
for (int j=0; j<[DateSortArry2Copy count]; j++) {
NSString *sectiondateStr2 = [NSString stringWithFormat:@"%@",[DateSortArry2Copy objectAtIndex:j]];
if ([[DateSortArry2 objectAtIndex:i] isEqualToString:sectiondateStr2]) {
[Arry addObject:sectiondateStr2];
}
}
[SumArry addObjectsFromArray:Arry];
[Arry removeAllObjects];
}
代码得到的结果:
SumArry:(
"20130227",
"20130227",
"20130227",
"20130226",
"20130226",
"20130226",
"20130225",
"20130225")
要求的结果:
SumArry:((
"20130227",
"20130227",
"20130227",
),
(
"20130226",
"20130226",
"20130226",
),
(
"20130225",
"20130225"
))
不知道应该怎么实现。