我正在尝试从项目中的支持文件文件夹中加载本地 HTML 文件...我不断收到此消息...线程 1:断点 1.1,我不知道为什么,我的 Web 视图代码如下
#import "WPViewController.h"
@interface UIViewController ()
@end
@implementation WPViewController
@synthesize viewWeb;
- (void)viewDidLoad {
[super viewDidLoad];
NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"localHTML"];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[viewWeb loadRequest:request];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (IBAction)dismissView:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
@end
标题...
#import <UIKit/UIKit.h>
@interface WPViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *viewWeb;
- (IBAction)dismissView:(id)sender;
@end