2013-02-28 3 views
0

보기 컨트롤러간에 전환하는 데 문제가 있습니다.NSInternalInconsistencyException 오류

내 md360AppDelegate.h 헤더는이

#import <UIKit/UIKit.h> 
@class md360ViewController; 
@interface md360AppDelegate : UIResponder <UIApplicationDelegate> 
@property (strong, nonatomic) UIWindow *window; 
@property (strong, nonatomic) md360ViewController *viewController; 
@property (strong, nonatomic) UINavigationController *navigationController; 
@end 

처럼 보이는 내 md360AppDelegate.m 구현은 다음과 같습니다.

#import "md360AppDelegate.h" 
#import "md360ViewController.h" 

@implementation md360AppDelegate 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    // Override point for customization after application launch. 
    self.viewController = [[md360ViewController alloc] initWithNibName:@"md360ViewController" bundle:nil]; 
    self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController]; 
    [self.navigationController setNavigationBarHidden:YES animated:YES]; 
    [self.window setRootViewController:self.navigationController]; 
    [self.window makeKeyAndVisible]; 
    return YES; 
} 
@end 

저는 UINavigationController의 인스턴스를 만들고이 클래스의 navigationController 속성에 저장합니다.

사용자가 md360ViewController에서 버튼을 클릭하면 ViewController를 변경하려고합니다.

내 md360ViewController.h는 다음과 같습니다.

@interface md360ViewController : UIViewController 
@property IBOutlet UIButton *homePathwayBtn; 
@property IBOutlet UIButton *homeDiseaseBtn; 
@property IBOutlet UIButton *homePipelineBtn; 
- (IBAction)homeButton:(id)sender; 
@end 

내 구현

#import "md360ViewController.h" 
#import "md360AppDelegate.h" 
#import "pipeViewDisease.h" 
#import <QuartzCore/QuartzCore.h> 

    - (IBAction)homeButton:(id)sender { 
     UIViewController *pipeViewDisease = [[UIViewController alloc] initWithNibName:@"pipeViewDiease" bundle:nil]; 
     [self.navigationController pushViewController:pipeViewDisease animated:YES]; 
    } 

같은 때 내가 메시지를 다음과 같이있는 UIButton의 응용 프로그램 충돌을 클릭 보인다.

때문에, 이유 캐치되지 않는 예외 'NSInternalInconsistencyException'응용 프로그램 종료 : ' 번들에 NIB를로드 할 수 없습니다 :'pipeViewDiease '' '이름'NSBundle (로드)

될 수 있는지 문제?

답변

1

은 아마 단지 맞춤법이 틀린 NIB 이름 :

initWithNibName:@"pipeViewDiease" 

가 있어야한다 :

initWithNibName:@"pipeViewDisease" 
          ^
+0

권자, 감사합니다, 고마워요 :) –

+0

@IbrahimAzharArmar 그것은 발생합니다. – trojanfoe

1

가 맞춤법 실수 (pipeViewDisease해야한다)이 아니라면,이 오류는 일반적으로 파일이 다시 때 발생 xCode 환경 외부에서 명명되었습니다.

는이 문제를 해결하려면 다음
  • 프로젝트에 프로젝트에서
  • 다시 가져 오기 파일을 해당 파일을 제거합니다.
관련 문제