2011-01-31 2 views
0

나는 탭 막대 응용 프로그램이 있습니다. 모든 것이 정상적으로 작동하며 두 번째 탭으로 전환 할 때를 제외하고는 모든 탭을 전환 할 수 있습니다. ProductViewClass보기가 업데이트되지 않고 콘솔 출력이 아래로 빠져 나옵니다. 나는 UIWebView와 UILabel을 제외하고는이 뷰에서 아무 것도 가지고 있지 않다. UIWebView를 삭제하면 성공적으로 실행되며 다른 UIWebView를 추가하면 여전히 작동합니다. IBOutlet을 파일 소유자와 UIWebView에 연결할 때만 작동이 멈 춥니 다.UIWebView 던지고 NSUnknownKeyException iPad

NSString *urlString = @"http://www.google.com/"; 
    NSURL *theURL = [NSURL URLWithString:urlString]; 
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:theURL]; 
    [productWebView loadRequest:urlRequest]; 
    NSLog(@"Google loaded"); 

ProductWebView.h의 전체 내용은 다음과 같다 :

This GDB was configured as "x86_64-apple-darwin".Attaching to process 52523. 
2011-01-30 19:18:28.907 FairCom[52523:40b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x4d06eb0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key productWebView.' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x00da8be9 __exceptionPreprocess + 185 
    1 libobjc.A.dylib      0x00efd5c2 objc_exception_throw + 47 
    2 CoreFoundation      0x00da8b21 -[NSException raise] + 17 
    3 Foundation       0x000296cf _NSSetUsingKeyValueSetter + 135 
    4 Foundation       0x0002963d -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285 
    5 UIKit        0x004a88d6 -[UIRuntimeOutletConnection connect] + 112 
    6 CoreFoundation      0x00d1f2cf -[NSArray makeObjectsPerformSelector:] + 239 
    7 UIKit        0x004a72ed -[UINib instantiateWithOwner:options:] + 1041 
    8 UIKit        0x004a9081 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168 
    9 UIKit        0x00361a94 -[UIViewController _loadViewFromNibNamed:bundle:] + 70 
    10 UIKit        0x0035f709 -[UIViewController loadView] + 120 
    11 UIKit        0x0035f5e3 -[UIViewController view] + 56 
    12 UIKit        0x00372230 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 120 
    13 UIKit        0x00370d86 -[UITabBarController transitionFromViewController:toViewController:] + 64 
    14 UIKit        0x00372b7e -[UITabBarController _setSelectedViewController:] + 263 
    15 UIKit        0x003729ed -[UITabBarController _tabBarItemClicked:] + 352 
    16 UIKit        0x002b1a6e -[UIApplication sendAction:to:from:forEvent:] + 119 
    17 UIKit        0x004af1f2 -[UITabBar _sendAction:withEvent:] + 422 
    18 UIKit        0x002b1a6e -[UIApplication sendAction:to:from:forEvent:] + 119 
    19 UIKit        0x003401b5 -[UIControl sendAction:to:forEvent:] + 67 
    20 UIKit        0x00342647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527 
    21 UIKit        0x0034016c -[UIControl sendActionsForControlEvents:] + 49 
    22 UIKit        0x002b1a6e -[UIApplication sendAction:to:from:forEvent:] + 119 
    23 UIKit        0x003401b5 -[UIControl sendAction:to:forEvent:] + 67 
    24 UIKit        0x00342647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527 
    25 UIKit        0x003411f4 -[UIControl touchesEnded:withEvent:] + 458 
    26 UIKit        0x002d60d1 -[UIWindow _sendTouchesForEvent:] + 567 
    27 UIKit        0x002b737a -[UIApplication sendEvent:] + 447 
    28 UIKit        0x002bc732 _UIApplicationHandleEvent + 7576 
    29 GraphicsServices     0x016dea36 PurpleEventCallback + 1550 
    30 CoreFoundation      0x00d8a064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 
    31 CoreFoundation      0x00cea6f7 __CFRunLoopDoSource1 + 215 
    32 CoreFoundation      0x00ce7983 __CFRunLoopRun + 979 
    33 CoreFoundation      0x00ce7240 CFRunLoopRunSpecific + 208 
    34 CoreFoundation      0x00ce7161 CFRunLoopRunInMode + 97 
    35 GraphicsServices     0x016dd268 GSEventRunModal + 217 
    36 GraphicsServices     0x016dd32d GSEventRun + 115 
    37 UIKit        0x002c042e UIApplicationMain + 1160 
    38 FairCom        0x00001be0 main + 102 
    39 FairCom        0x00001b71 start + 53 
    40 ???         0x00000001 0x0 + 1 
) 
terminate called after throwing an instance of 'NSException' 
sharedlibrary apply-load-rules all 
(gdb) 
: 여기
#import <UIKit/UIKit.h> 
@interface ProductViewClass : UIViewController { 

    IBOutlet UIWebView *productWebView; 
} 

@property(nonatomic, retain) UIWebView *productWebView; 
@end 

콘솔 출력의 합성 및 productWebView 해제 외에 ProductWebView.m의 유일한 비 템플릿 코드가 이쪽

도움 주셔서 감사합니다.

+0

가능한 복제본 [이 클래스는 키 값에 대한 코드 호환 키 값이 아닙니다.] (http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for - 열쇠) – jtbandes

답변

6

님은 펜촉을 장착하고 있습니다. 이 펜촉에는 productWebView이라는 콘센트가 있는데, 아마 웹에 연결되어있을 것입니다. 예외는 콘센트 productWebView이 실제로 존재하지 않는다는 것을 알려주는 것입니다. 그것이 이상한 곳이 있습니다. 오류는이 콘센트가없는 <UIViewController 0x4d06eb0> 개체를 나타냅니다. 이상한 비트는 실제로보기 컨트롤러 하위 클래스의 이름 대신 UIViewController이라고 말합니다. File 's Owner가 View Controller 하위 클래스 중 하나로 설정되어있는 것처럼 들리지만 런타임에는 실제로 UIViewController의 인스턴스 만 사용하고있는 것 같습니다. 탭 표시 줄 컨트롤러의 탭을 나타내는 모든보기 컨트롤러가 UIViewController 인스턴스 대신 UIViewController의 실제 올바른 하위 클래스인지 확인해야합니다.

+0

고마워요! 나는 돌아가서 나의 UITabBarItems를 보았고 특정 nib/class로 설정되지 않았으므로 왜 그들이 전혀 효과가 없었는지 궁금하다. – SeniorShizzle

관련 문제