1

is there any way to put out the alphabet in iOS?
I want to populate a table with all the letters of an alphabet.
And also other alphabets. Any suggestion to do that without any extensions or smth. else ??

If any way to do so with an extension, please let me know :)

Edit 1:
Thank you Carlos Chiari, here is my solution:

int asciiCode = 65;

for (asciiCode=65; asciiCode<=90; asciiCode++) {
    NSString *string = [NSString stringWithFormat:@"%c", asciiCode];
    NSLog(@"%@", string);
}

found here and just putted in a for condition: How to convert ASCII value to a character in Objective-C?

Community
  • 1
  • 1
brush51
  • 5,691
  • 6
  • 39
  • 73

1 Answers1

0

Not sure about the exact syntax since I haven't played with iOS in a while, but just loop through the different ASCII characters from A - Z. For instance in .Net it would be something like

For i as Integer = 65 To 90
  Label.Text &= Char(i)
Next i

Char(i) prints the character with ASCII code "i", ASCII code for capital A is 65. ASCII code for capital Z is 90. So i loop through it from 65 to 90, which gives me A-Z. Hope this helps :)

Losbear
  • 3,255
  • 1
  • 32
  • 28
  • 1
    .Net isn't a great iOS solution, and "other alphabets" precludes ASCII. If you really want to look at Unicode characters you could use `+[NSString stringWithCharacters:length:]`. – David Dunham Nov 15 '11 at 19:10
  • Hello David Dunham, see my Edit 1. Carlos Chiari gives me the right direction and the for condition in my edit puts out the whole alphabet from A-Z. Why you give a -1? It was just a food for thought :)) – brush51 Nov 23 '11 at 12:00