我通过以下方式在NSAttributedString中使用图标:NSTextAttachment*textAttachment=[[NSTextAttachmentalloc]init];textAttachment.image=[UIImageimageNamed:@"notes-18w_18h.png"];NSAttributedString*attrStringWithImage=[NSAttributedStringattributedStringWithAttachment:textAttachment];[headerASreplaceCharactersInRange:N