0

2 番目のページに移動してUITableviewから 3 番目のページに移動しようとしましたが、問題はコードが機能していないことです。これは AppDelegate.m ファイルと SecondViewController.m ファイルの両方のコードです。コードを
確認して、私が間違っていることを提案してください

SecondViewController.m ファイル コード

 - (void)tableView: (UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
     {

         ThirdViewController *third = [[ThirdViewControllerr alloc] initWithNibName:     @"ThirdViewControllerr" bundle:nil];

         ForthViewController *forth = [[ForthViewControlle alloc] initWithNibName: @"ForthViewController" bundle:nil];

                   if(indexPath.row==0)
                    {
                         [[self navigationController] pushViewController:third animated:YES];

                     }                    

                    if(indexPath.row==1)
                     {
                       [[self navigationController] pushViewController:forth animated:YES];

                     }


AppDelegate.m ファイルで、UITableview を使用して魔女の Secondviewcontroller のコードを記述します。また、AppDelegate.m ファイル内で UINavigationController を初期化しました。AppDelegate.m ファイル内で UINavigationController を使用せずに、できるだけ早く返信してください。 UItableview ナビゲーション

AppsDelegate.m ファイル

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {

        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        // Override point for customization after application launch.
        self.viewController = [[MobileViewController alloc]   initWithNibName:@"MobileViewController" bundle:nil];
        self.window.rootViewController = self.viewController;
        [self.window makeKeyAndVisible];
       return YES;


        self.window1=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]];
      self.viewController1=[[HealthCalculatorsViewController alloc]initWithNibName:@"HealthCalculatorsViewController" bundle:nil];
        UINavigationController *nav1=[[UINavigationController alloc]initWithRootViewController:_viewController1];
        self.window1.rootViewController=nav1;
       [self.window1 makeKeyAndVisible];
        return YES;
        }

私を案内してください。
ありがとう。

4

1 に答える 1