1
我是iOS開發新手。我試圖做一個非常簡單的應用程序只給出了顯示網頁一個UIWebView:UIWebView顯示空白iOS設備初學者
ViewController.m:
#import "ViewController.h"
@implementation ViewController
@synthesize webView = _webView;
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *urlAddress = @"http://jsfiddle.net/emj365/qaQnF/embedded/result/";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:requestObj];
}
...
ViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController {
UIWebView * _webView;
}
@property (nonatomic, retain) IBOutlet UIWebView * webView;
@end
UIWebView中顯示空白。怎麼了?
「你檢查,看看是否出口實際上是連接在廈門國際銀行的網頁流量?」而已! :P我很新。 – emj365 2012-02-01 07:46:18
沒問題,連接插座是容易忘記的事情。 – 2012-02-01 07:51:34