将html文本添加到我的UIWebView

use*_*477 4 iphone objective-c uiwebview ios

我想从我的数据库添加文本到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
Run Code Online (Sandbox Code Playgroud)

在他们中:

@synthesize message,body;

-(void)getNoticeData:(NSString *)noticeID:(NSString *)noticeTitle {


//some taks not useful for this code


NSString *bodyText = [dict objectForKey:@"introtext"];

[body loadHTMLString: bodyText];
}
Run Code Online (Sandbox Code Playgroud)

我得到的错误:

No visible @interface for 'UIWebView' declares the selector 'loadHTMLString:'
Run Code Online (Sandbox Code Playgroud)

为什么会这样?先感谢您

Man*_*wal 7

尝试使用这样的

NSString*html = @"应该是halfI我希望答案只有42";
[webView loadHTMLString:html baseURL:nil];


Pfi*_*itz 5

正确的电话会是 loadHTMLString:baseURL: