#import"ViewController.h"@interfaceViewController()@property(nonatomic,strong) NSMutableArray * mutableArry;@end@implementationViewController- (void)viewDidLoad {
[super viewDidLoad];
_mutableArry = [[NSMutableArray alloc]init];
NSArray * ary = @[@[@[@[@[@[@"woqu"],@"888"]]]],@[@"123"],@[@[@[@"000",@"010"]]],@"321",@[@"555",@[@"666"]],@"777"];
[self getAllObject:ary and:0];
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"等于:%@",_mutableArry);
}
-(void)getAllObject:(NSArray *)array and:(int)num{
while (num
if (![array[num] isKindOfClass:[NSArray class]]) {
[_mutableArry addObject:array[num]];
num++;
continue;
}else if([array[num] isKindOfClass:[NSArray class]]){
[self getAllObject:array[num] and:0];
num++;
}
}
}
网友评论