Existe-t-il un moyen d'avoir une sorte de texte enrichi dans un fichier et de charger le fichier dans un NSAttributedString? J'ai regardé dans le chargement d'un fichier .rtf dans une chaîne NSAttributed:Charger NSAttributedString à partir du fichier
NSString *filePathFooter = [[NSBundle mainBundle] pathForResource:kFooterFileName ofType:@"rtf"];
NSError *error = nil;
NSAttributedString *string = [[NSAttributedString alloc] initWithFileURL:[NSURL URLWithString:filePathFooter]
options:nil
documentAttributes:NULL
error:&error];
Mais cela me laisse avec:
Error Domain=NSCocoaErrorDomain Code=258 "The operation couldn’t be completed. (Cocoa error 258.)"
Est-il possible de le faire?