Search code examples
iphoneobjective-cmutablecore-foundationnsattributedstring

How can I clear the contents of an NSMutableAttributedString?


I have an ivar which is alloc-inited in the init of an object:

attString = [[NSMutableAttributedString alloc] init];

On a loop, I want to clear the contents of attString and re-use it. How do I do this?

Thanks!


Solution

  • [[attString mutableString] setString:@""];