私のアプリは に始まりますLoginViewController
。ログインビューには「登録」ボタンが 1 つあり、コードは以下のとおりです。[登録] をクリックしてアプリを起動しても、何も起こりません。しかし、ログインしてログアウトすると、登録ボタンは正しく機能します。
これが起こる問題は何ですか?
AppDelegate:
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
//Load View Controllers;
self.vcClubs = [[[ClubsViewController alloc] init] autorelease];
self.vcParties = [[[PartiesViewController alloc] init] autorelease];
self.vcEditProfile = [[[EditProfileViewController alloc] init] autorelease];
self.navClubs = [[[UINavigationController alloc] initWithRootViewController:self.vcClubs] autorelease];
self.navClubs.navigationBarHidden = YES;
self.navParties = [[[UINavigationController alloc] initWithRootViewController:self.vcParties] autorelease];
self.navParties.navigationBarHidden = YES;
// Load Login View
UIViewController *loginView = [[[LoginViewController alloc] init] autorelease];
self.window.rootViewController = loginView;
[self.window makeKeyAndVisible];
return YES;
}
...
- (void)login
{
self.vcMenu = [[[MenuViewController alloc] init] autorelease];
self.vcLocationMenu = [[[LocationMenuViewController alloc] init] autorelease];
self.mainController = [[[MainViewController alloc] init] autorelease];
self.mainController.leftViewController = self.vcMenu;
self.mainController.rightViewController = self.vcLocationMenu;
[self.mainController setMainViewController:self.navParties];
[self.mainController showMainViewControllerAnimated:YES];
self.window.rootViewController = self.mainController;
CATransition *transition = [[[CATransition alloc] init] autorelease];
transition.duration = 1;
transition.type = kCATransitionFade;
transition.subtype = kCATransitionFromBottom;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[self.window.layer addAnimation:transition forKey:@"login"];
}
...
LoginController.php:
...
- (IBAction)onTapSignupButton:(id)sender
{
RegisterViewController *controller = [[[RegisterViewController alloc] init] autorelease];
[self.navigationController pushViewController:controller animated:YES];
NSLog(@"%@", self.navigationController);
}
...
アプリの開始時に NSLOG を返します。
2013-02-18 02:18:29.986 App[32652:c07] (null)