我試圖從我的項目中的支持文件文件夾中加載本地HTML文件...我不斷收到此消息...線程1:斷點1.1,我不知道爲什麼,我對Web視圖代碼如下在UIWebView中加載本地HTML文件時遇到問題
#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