보기 컨트롤러간에 전환하는 데 문제가 있습니다.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 (로드)
될 수 있는지 문제?
권자, 감사합니다, 고마워요 :) –
@IbrahimAzharArmar 그것은 발생합니다. – trojanfoe