try this:
NSArray *array1= @[@"fizan",@"nike",@"pogo"];
NSArray *array2= @[@"round",@"rectangle",@"square"];
NSArray *array3= @[@"frame",@"frame",@"frame"];
NSMutableArray *array = [[NSMutableArray alloc] initWithArray:@[array1,array2,array3]];
NSMutableArray *output = [[NSMutableArray alloc] init];
NSString *a;
NSInteger count = array.count;
for (int i = 0; i<array1.count; i++) {
a = @"";
for (int j = 0; j<count; j++) {
a = [a isEqualToString: @""] ? [NSString stringWithFormat:@"%@",[[array objectAtIndex:j] objectAtIndex:i]] : [NSString stringWithFormat:@"%@ %@",a,[[array objectAtIndex:j] objectAtIndex:i]];
}
[output addObject:a];
}
for (int i = 0; i < output.count; i++) {
NSLog(@"value %i -> %@",i+1,output[i]);
}
Hope this helps!
UPDATE:
NSArray *array1= @[@"fizan",@"",@"pogo"];
NSArray *array2= @[@"round",@"rectangle",@"square"];
NSArray *array3= @[@"frame",@"frame",@"frame"];
NSMutableArray *array = [[NSMutableArray alloc] initWithArray:@[array1,array2,array3]];
NSMutableArray *output = [[NSMutableArray alloc] init];
NSString *a;
NSInteger count = array.count;
for (int i = 0; i<array1.count; i++) {
a = @"";
for (int j = 0; j<count; j++) {
a = [a isEqualToString: @""] ? [NSString stringWithFormat:@"%@",[[array objectAtIndex:j] objectAtIndex:i]] : [NSString stringWithFormat:@"%@ %@",a,[[array objectAtIndex:j] objectAtIndex:i]];
}
[output addObject:a];
}
for (int i = 0; i < output.count; i++) {
NSLog(@"value %i -> %@",i+1,output[i]);
}
I have tested this code. It works perfect. Check again and reconsider the issue.