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]];
}
Programming solutions, source code, solutions to tech problems and other tech related stuff.
Showing posts with label objective c. Show all posts
Showing posts with label objective c. Show all posts
Wednesday, January 12, 2011
Tuesday, January 11, 2011
Subscribe to:
Posts (Atom)