Hi everyone,
I have written this small method to help generate characters for a popUpButton. It is also to help me further my ( lack of) understanding of unichar etc
So, here is the code
current output: character: index: 243 character: 酐烚翿 // repeated for each index.
Any insight will be greatly appreciated.
Thank you.
I have written this small method to help generate characters for a popUpButton. It is also to help me further my ( lack of) understanding of unichar etc
So, here is the code
Code:
@interface NSString (characterGenerator)
+(NSArray *) characterGenerator;
@end
@implementation NSString (characterGenerator)
+(NSArray *) characterGenerator
{
unichar i;
//uint i;
NSArray *arr = [NSArray array];
unichar array[UPPERLIMIT];
NSString *s = nil;
for ( i = 0; i < UPPERLIMIT; i++) // UPPERLIMIT = 256
{
array[0] = i;
array[1] = 'U+0000';
s = [NSString localizedStringWithFormat:@"index: %hi character: %S", i, arr[0]];
arr = [arr arrayByAddingObject:s];
NSLog(@"index: %hi character: %@", i, [arr lastObject]);
}
return arr;
}
@end
current output: character: index: 243 character: 酐烚翿 // repeated for each index.
Any insight will be greatly appreciated.
Thank you.