我有此錯誤:在ios中添加HTML路徑時出現錯誤
「沒有可見的@interface for'NSBundle聲明selector'pathforresource:類型」。
#import "ViewController.h"
@interface ViewController()
@end
@implementation ViewController
@synthesize WebView1;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *localFilePath = [[NSBundle mainBundle] pathForResoursce:@"www/index" ofType:@"html"] ;
NSURLRequest *localRequest = [NSURLRequest requestWithURL:
[NSURL fileURLWithPath:localFilePath]] ;
[WebView1 loadRequest:localRequest] ;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
#import <UIKit/UIKit.h>
#import "ViewController.h"
@interface ViewController : UIViewController
@property (nonatomic,retain) IBOutlet UIWebView *WebView1;
@end
你進口的基礎呢? – johnyu
你是什麼意思進口的基礎? – Myworld
「#import」 –
johnyu