0

我想替换NSMutableArrayobect 中的数组对象。我正在获取oldArray_alertsArray改变它的价值,并想oldArraynewArray. 但是没有效果!!

NSArray *oldArray = (NSArray *)[_alertsArray objectAtIndex:[indexPath row]];
NSMutableArray *newArray = [[NSMutableArray alloc] initWithArray:oldArray copyItems:YES];
[newArray replaceObjectAtIndex:3 withObject:@"YES"];
[_alertsArray replaceObjectAtIndex:[indexPath row] withObject:newArray];
4

1 回答 1

0
NSMutableArray *newArray = [_alertsArray mutableCopy];
[newArray replaceObjectAtIndex:3 withObject:@"YES"];
_alertsArray = newArray;
于 2013-01-14T22:20:13.900 回答