I want to add text from my database to a UIWebView, but I have an error I can't deal with.
in my .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
In the .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];
}
The error I get:
No visible @interface for 'UIWebView' declares the selector 'loadHTMLString:'
why is this happening? Thank you in advance
try using like this
NSString *html = @"Should be halfI wish the answer were just 42";
[webView loadHTMLString:html baseURL:nil];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With