안녕하세요. 다시 인터넷에 연결되어 있지 않으면 아래 앱에 오류가 표시됩니다. 다음은 파일입니다. FirstViewController.h :iphone 앱에 인터넷 오류가 표시되지 않습니다.
//
// FirstViewController.h
// DailyJoke
//
// Created by John Bridge on 5/4/11.
// Copyright 2011 Bridge and co. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController {
IBOutlet UIWebView *webView;
}
@end
여기
입니다 FirstViewController.m : // // FirstViewController.m // DailyJoke // 은 5/4/11에 존 브리지에 의해 만들어진 //. // Copyright 2011 Bridge and co. 판권 소유. 사람의 //
#import "FirstViewController.h"
@implementation FirstViewController
-(void)awakeFromNib
{
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.johnbridge180.com/IPhoneIPad/IPhone/DailyJoke/DailyJoke.html"]]];
}
/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
*/
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/
/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end
이 아직도 혼동하고있어 srry 메신저 당신은 샘플 코드를 시도하는 시간을 소요 –
새로운 포기하기 전에 더 많은 문서를 읽으십시오. – pzearfoss