我想将我的数据库中的文本添加到 UIWebView,但出现无法处理的错误。
在我的 .h 中:
#import <UIKit/UIKit.h>
@interface readNotice : UIViewController {
IBOutlet UILabel *message;
IBOutlet UIWebView *body;
}
@property(nonatomic, retain)IBOutlet UILabel *message;
@property(nonatomic, retain)IBOutlet UIWebView *body;
-(void)getNoticeData:(NSString *)noticeID:(NSString *)noticeTitle;
@end
在 .m 中:
@synthesize message,body;
-(void)getNoticeData:(NSString *)noticeID:(NSString *)noticeTitle {
//some taks not useful for this code
NSString *bodyText = [dict objectForKey:@"introtext"];
[body loadHTMLString: bodyText];
}
我得到的错误:
No visible @interface for 'UIWebView' declares the selector 'loadHTMLString:'
为什么会这样?提前谢谢你
最佳答案
尝试这样使用
NSString *html = @"Should be halfI wish the answer were just 42";
[webView loadHTMLString:html baseURL:nil];
关于iphone - 将 html 文本添加到我的 UIWebView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11257703/