NSString *filePath = [[NSBundle mainBundle] pathForResource:@"File1" ofType:@"rtf"];
NSData *myData = [NSData dataWithContentsOfFile:filePath];
if(myData) {
_textContent = [[NSString alloc] initWithData:myData encoding:NSUnicodeStringEncoding];
}
I am trying to read a Devanagari RTF file into a UI text view. My code is like belowNSString *filePath = [[NSBundle mainBundle] pathForResource:@"File1" ofType:@"rtf"];
NSData *myData = [NSData dataWithContentsOfFile:filePath];if(myData) {_textContent = [[NSString alloc] initWithData:myData encoding:NSUnicodeStringEncoding];}Where _textContent is a NSString*.This does not work. When I print _testContent it prints characters in a different language.When I preload the UITextView in storyboard by copy posting the test and print textView.text then the correct Devanagari text is printed.How do I load my rtf file into a UITextView?ThanksHrishi
Regards
Oliver Drobnik
Cocoanetics.com