0

How textview text value stored after bold,italic,underline in a NSString? I am newer in iOS. I am getting bold ,italic text on view but not save. This is my Code.

myTextView.allowsEditingTextAttributes =YES;
        NSString *tempMailBodyString= [NSString stringWithFormat:@"<html><body><div>%@</div></body></html>",myTextView.text];


- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
                       if (action == @selector(_showTextStyleOptions:)) {
                        return NO;
     }
            return [super canPerformAction:action withSender:sender];
}
Lennart
  • 9,657
  • 16
  • 68
  • 84

1 Answers1

0

If you are looking for how to use NSAttributedString/NSMutableAttributedString to add style or colour to your text ?

Then refer links 1 & 2,

  1. How do you use NSAttributedString? and

  2. Apple - NSAttributedString

If you are looking for how to save NSAttributedString/NSMutableAttributedString in a file or Core Data ?

Then refer link 3,

  1. Archive or Unarchive NSAttributedString. You can use the Archived NSData to save it, and you can Unarchive the NSData to get the NSAttributedString back.
Community
  • 1
  • 1