예를 들어 다른 프로젝트와 비교하면서 예제를 시도해 보았습니다. 그러나 내가 잘못하고있는 것을 보려면 아직 답을 찾지 못했습니다. 간단히 말해서 클래스에 대해 수행하려고 시도하는 것은 UIWebView
이 표시하는 URL을 변경하는 세 개의 버튼으로 분할 된 컨트롤입니다.UIWebView에서 페이지를 변경하는 분열 된 컨트롤
그러나 앱이 경우는 다음과 같은 콘솔 출력 출시에 충돌 실행
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x7f969ab2dd80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key appleWebView.'
*** First throw call stack:
다음
내 코드입니다 :ViewController.M
#import "ViewController.h"
@interface ViewController()
@property (weak, nonatomic) IBOutlet UIScrollView *theScroller;
@property (weak, nonatomic) IBOutlet UISegmentedControl *appleSite1;
@property (weak, nonatomic) IBOutlet UIWebView *myWebView;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
self.theScroller.contentSize = CGSizeMake(280, 1000.0);
}
- (IBAction)appleSite1:(UIButton *)sender
{
NSURL *url = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"http://www.google.com"]];
[self.myWebView loadRequest:[NSURLRequest requestWithURL:url]];
}
@end
ViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
//{
// IBOutlet UIWebView myWebView;
//}
//
@end
제가 누락 된 부분을 정확히 파악할 때까지 한 사이트 (이베이) 만 테스트합니다. 분명히 나는 학생이고, 그래서 나와 함께 견뎌야한다.
미리 감사드립니다.
어디서나 UiWebView를 만드십니까? –