[tmp setFont:[UIFont fontWithName:@"American Typewriter" size:18]];
the font name takes it from the array and continues to change the index.
So it will look like
[tmp setFont:[UIFont fontWithName:[fontArray objectAtIndex:desiredIndex] size:18]];
source
share