this is a silly n00b question but i just don't get it to work. I do believe that i need to convert to NSString and leverage "stringWithUTF8String:" but do not understand exactly how to implement it in this code so i get the right output in the NSLog. I have been looking around but it still do not work. The plist is correct.
My output is:
2010-11-07 21:43:00.419 plist_test[2984:207] Förbered och skriv
2010-11-07 21:43:00.425 plist_test[2984:207] KLART
2010-11-07 21:43:00.425 plist_test[2984:207] LÄS IN PLIST
2010-11-07 21:43:00.427 plist_test[2984:207] array2: (
ETT,
"TV\U00c5", ========Here is the problem, should be "TVÅ"
TRE,
FYRA
)
Here is the code i am using.
- (void)viewDidLoad {
NSLog(@"Förbered och skriv");
NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:@"ETT"];
[array addObject:@"TVÅ"];
[array addObject:@"TRE"];
[array addObject:@"FYRA"];
[array writeToFile:@"/Users/PeterK/Desktop/plisttest.plist" atomically: TRUE];
NSLog(@"KLART");
NSLog(@"LÄS IN PLIST");
NSMutableArray *array2 = [[NSMutableArray alloc] init];
array2 = [NSMutableArray arrayWithContentsOfFile:@"/Users/PeterK/Desktop/plisttest.plist"];
NSLog(@"array2: %@", array2); ====here is the output
[super viewDidLoad];
}