2012-09-01 3 views
0

기본적으로 웹 페이지를로드하는 앱 (iphone 및 ipad 용 범용)을 구현하고 있습니다. iPhone 용 webview가 제대로로드되지만 iPad WebView는 아무 것도하지 않습니다. Heres는iPad 용 WebView가 페이지를로드하지 않고 있습니다.

내 ViewController.m

#import "ViewController.h" 

@interface ViewController() 
@property (weak, nonatomic) IBOutlet UIWebView *webView; 
@property (weak, nonatomic) IBOutlet UIWebView *webViewiPad; 

@end 

@implementation ViewController 
@synthesize webView = _webView; 
@synthesize webViewiPad = _webViewiPad; 

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    // Do any additional setup after loading the view, typically from a nib. 

    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.at"]]]; 
    [self.webViewiPad loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.at"]]]; 
} 
+0

당신에게 웹보기 중 하나를 인스턴스화하지 마십시오. –

+0

ipad에서 인터넷 연결을 확인하십시오 – Rajneesh071

+0

인터넷 연결이 작동 중입니다 ... –

답변

0

의 ViewController가로드 할이 :

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 

    self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease]; 
    } 
else 
{ 
    self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease]; 
} 

바인딩 webViewiPad 아이 패드 XIB 각각 아이폰 XIB에 웹보기에

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) //load differnt xib according to iphone and ipad 
{ 
    [self.webViewiPad loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.at"]]]; 

} 
else 
{ 
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.at"]]]; 

} 
+0

이것은 내가 믿는 문제와 관련이 없습니다. 덕분에 –

+0

. 그러나 그것은 그다지 변하지 않았습니다. 아이폰이 작동, ipad 아무것도로드되지 않습니다. –

+0

check 편집 된 답변 –