Objective C makes it easy:
NSMutableArray *alphabetArray;
alphabetArray = [[NSMutableArray alloc] init];
for(char c = 'A'; c <= 'Z'; c++)
{
[alphabetArray addObject:[NSString stringWithFormat:@"%c", c]];
}
Or if you want to do lower case:
NSMutableArray *alphabetArray;
alphabetArray = [[NSMutableArray alloc] init];
for(char c = 'a'; c <= 'z'; c++)
{
[alphabetArray addObject:[NSString stringWithFormat:@"%c", c]];
}
No comments:
Post a Comment