Add the which Any Format File (doc,rtf,.....etc) you want shown in WebView.
.h File:
@interface LocalFileWebView : UIViewController
{
IBOutlet UIWebView *Webviewlocal;
}
@property(nonatomic,retain) IBOutlet NSString *Name;
@end
.m File:
@synthesize Name;
- (void)viewDidLoad
{
[super viewDidLoad];
self.title=@"TamilNadu Details";
self.Name=@"Tamilnadu";
NSString *path=[[NSBundle mainBundle] pathForResource:self.Name ofType:@"rtf"];
NSURL *url=[NSURL fileURLWithPath:path];
NSURLRequest *req=[NSURLRequest requestWithURL:url];
[Webviewlocal loadRequest:req];
}
Output:
Map the WebView and Run the Application.
No comments:
Post a Comment