Ios 如何在Objective C中显示API中的HTML文本?

Ios 如何在Objective C中显示API中的HTML文本?,ios,objective-c,iphone,Ios,Objective C,Iphone,我从API中得到一个字符串,它是“http://www.maximusautogroup.com/\“target=\”\u blank\“>here”。从这个字符串中,我必须将“here”显示为该链接的超链接。我不知道如何执行此操作。尝试以下操作: NSString *FileName = [[Url lastPathComponent] stringByDeletingPathExtension]; NSMutableAttributedString *attributeStrin

我从API中得到一个字符串,它是“http://www.maximusautogroup.com/\“target=\”\u blank\“>here”。从这个字符串中,我必须将“here”显示为该链接的超链接。我不知道如何执行此操作。

尝试以下操作:

   NSString *FileName = [[Url lastPathComponent] stringByDeletingPathExtension];
  NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:FileName];
[attributeString addAttributes:@{NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle)
     , NSBackgroundColorAttributeName: [UIColor blueColor]} range:NSMakeRange(0, [attributeString length])]

        [_buyButton setAttributedTitle:attributeString forState:UIControlStateNormal];

您是否使用textfield显示此链接或标签。@Aditya Pandey您可以尝试。并且。我使用的是textview…。我得到的完整字符串是“我们的正式工作时间是东部时间上午9点到下午6点。我们将在下一个工作日与您联系。”。请访问“target=”“\u blank\”>了解我们的索赔公关”;