I私AppDelegate
に次のコードを持っている:UINavigationController pushViewControllerのviewDidLoadで働いていない
#import <UIKit/UIKit.h>
@class PersonalDiarySystemViewController;
@interface PersonalDiarySystemAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
PersonalDiarySystemViewController *viewController;
UINavigationController *navigationController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet PersonalDiarySystemViewController *viewController;
@property (nonatomic, retain) UINavigationController *navigationController;
@end
#import "PersonalDiarySystemAppDelegate.h"
#import "PersonalDiarySystemViewController.h"
@implementation PersonalDiarySystemAppDelegate
@synthesize window;
@synthesize viewController;
@synthesize navigationController;
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Set the view controller as the window's root view controller and display.
self.window.rootViewController = self.viewController;
navigationController = [[UINavigationController alloc] initWithRootViewController:self.window.rootViewController];
navigationController.navigationBar.tintColor = [UIColor
colorWithRed:217.0/255
green:33.0/255
blue:0
alpha:1];
navigationController.navigationBarHidden = YES;
[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
return YES;
}
マイrootviewcontrollerは、コントローラはそのviewDidLoad
方法で積み重ねが、何らかの理由でビューが取得されていないナビゲーションに別のViewControllerをロードしようとしますプッシュ:起こっていただきました
-(void) viewDidLoad{
lvc = [[LoginViewController alloc] init];
//lvc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[lvc setDelegate:self];
//[self presentModalViewController:lvc animated:YES];
[self.navigationController pushViewController:lvc animated:YES];
}
私は確信してエラーを取得していないそうではないよ... presentModalViewController
作品を使用して...そう、本当に混乱しています!
それはどちらも動作しません... – user559142
'LoginViewController'をインポートしていますか?新しいビューをどのようにプッシュするかが原因です。 – WrightsCS
はい私は...私がそうでなかったらそれはコンパイルされませんでした... – user559142