I have array:
NSArray *array = [NSArray arrayWithObjects:@"One",@"Second",@"Third", nil];
I want to get this code result in console:
[One]
background = 0,
[Second]
background = 1,
[Third]
background = 2,
I try to use this code to do it:
Int n = 0;
for (; n < 3; n++)
{
NSArray *array = [NSArray arrayWithObjects:@"One",@"Second",@"Third", nil];
NSString *stringFromArray = [array componentsJoinedByString:@"], background = %i ["];
NSLog (@"%@",stringFromArray);
}
How to solve the problem?