0

私が使用しているコード

  NSLog(@"before Navigate to second activity");
    Signature *temp = [[Signature alloc]initWithNibName:@"Signature" bundle:nil];

    [self.navigationController pushViewController:temp animated:YES];

     NSLog(@"after Navigate to second activity");

コンソールでは、両方のログ ステートメントが出力されますが、アプリが次のビューに移動しません。修正してください。

4

4 に答える 4

0

CreditsViewController *viewController = [[CreditsViewController alloc] init];

[[self navigationController] pushViewController:viewController animation:YES];

[viewController リリース];

上記のコードで試すことができます

于 2012-11-20T08:56:12.217 に答える
0

アプリでを使用していない場合は、 をUINavigationController呼び出すことができません。代わりに次pushViewControllerを使用してください。presentViewController:animated:completion:

[self presentViewController:temp animated:YES completion:nil];

詳細については、ドキュメントを確認してください

于 2012-11-19T12:13:07.300 に答える
0

私はあなたのアプリケーションがnavigationControllerを使用していないと思うので、AppDelegate.mファイルでこのようにrootViewControllerを割り当てます..

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    RootViewController *viewController1 = [[[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil] autorelease];
    UINavigationController   *navviewController=[[UINavigationController alloc]initWithRootViewController:viewController1];
    self.window.rootViewController = navviewController;
    [self.window makeKeyAndVisible];
    return YES;
}

その後、その動作を確認してください..

于 2012-11-19T11:38:20.360 に答える
0

The log messages would show anyway, so no surprise there. Add a callback to the delegate for that navigation controller (you must first set a delegate of course) for

navigationController:didShowViewController:animated:

There you can make sure that the viewController passed (make sure Signature is a ViewController instance).

于 2012-11-19T11:42:54.167 に答える