我正在尝试使用情节提要实现 2 个 Web 视图,它们都链接到另一个在线网页。出于某种原因,我没有收到任何错误,但只有 PriceViewController 有效。其他VC生成白页……
我正在使用这 4 个文件:
价格视图控制器.h
#import <UIKit/UIKit.h>
@interface PricesViewController : UIViewController
{
IBOutlet UIWebView *WebView; }
@property (nonatomic, retain) UIWebView *WebView;
@end
价格视图控制器.m
#import "PricesViewController.h"
@interface PricesViewController ()
@end
@implementation PricesViewController @synthesize WebView;
- (void)viewDidLoad {
[WebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.sparein.be/full_pricelist.pdf"]]];
[super viewDidLoad];
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self; }
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. }
@end
预订视图控制器.h
#import <UIKit/UIKit.h>
@interface ReservationsViewController : UIViewController
{
IBOutlet UIWebView *WebView2; }
@property (nonatomic, retain) UIWebView *WebView2;
@end
预订视图控制器.m
#import "ReservationsViewController.h"
@interface ReservationsViewController ()
@end
@implementation ReservationsViewController @synthesize WebView2;
- (void)viewDidLoad {
[WebView2 loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.be"]]];
[super viewDidLoad];
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self; }
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. }
@end