NSArray *array1 = [[NSArray alloc] initWithObjects:@"Name1",12.0f,13.0f,14.0f,15.0f,nil];
NSArray *array2 = [[NSArray alloc] initWithObjects:@"Name2",1.0f,15.0f,64.0f,nil];
NSArray *array3 = [[NSArray alloc] initWithObjects:@"Name3",65.0f,80.0f,29.0f,nil];
NSMutableArray *mut = [[NSMutableArray alloc] initWithObjects:array1,array2,array3, nil];
NSMutableArray *mutla = [[NSMutableArray alloc] init];
for (int i = 0; i < mut.count; i++) {
[mutla addObjectsFromArray:[mut objectAtIndex:0]];
}
for (int i = 0; i < mutla.count; i++) {
NSLog(@"mutla is %@", [mutla indexOfObject:i]);//目前是这行报错 Thread1:EXC_BAD_ACCESS(code=1,address=7ffffff)
}
需要的效果是这样,把name,赋值给mutla,让mutla里面存储的都是name
|