技术: Objective-C, xCode 7
@property (nonatomic, copy) NSString *notes;
@synthesize notes;
example.notes = @"Click <a href='http://www.google.com'>here</a>";
NSString *msg = [@"" stringByAppendingFormat:@"%@", myAnnotation.notes];
UIAlertController *alertViewController = [UIAlertController alertControllerWithTitle: @"Title of Alert Box" message: msg preferredStyle: UIAlertControllerStyleAlert];
[alertViewController addAction: [UIAlertAction actionWithTitle: @"Close" style: UIAlertActionStyleCancel handler: nil]];
[self presentViewController: alertViewController animated: YES completion: nil];
试图让链接显示在警报框中,但是没有成功。只输出为纯文本。
这是否可能?如果可能,那么如何实现上述示例呢?
UIAlertController
仅支持纯文本。 - rmaddyNSString *msg = [@"" stringByAppendingFormat:@"%@", myAnnotation.notes];
的意义是什么?为什么不直接使用NSString *msg = myAnnotation.notes;
? - rmaddy