1

ビューコントローラーのプッシュに問題があります。これは私がやったことです: ボタンをクリックすると、このコードを使用してモーダル ビューを追加します。

- (void)addAction:(id)sender
{
    uipickerForContract *addViewController = [[uipickerForContract alloc] initWithNibName:@"uipickerForContract" bundle:nil];
    addViewController.delegate = self;

    addViewController.modalPresentationStyle = UIModalPresentationFormSheet;
    addViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

    [self presentModalViewController:addViewController animated:YES];

    addViewController.view.superview.frame = CGRectMake(50, 740, 695, 245);


}

この追加されたviewcontrollerには、他のviewcontrollerに移動するために使用したい完了ボタンが含まれています:そのコードを使用しますが、機能しませんでした.addeviewを閉じます:

 donebutton{

    nextview*s = [[nextview alloc]initWithNibName:@"nextview" bundle:nil];
    s.view.frame = CGRectMake(10, 20, 745, 755);
    //nextview contains the object that I want to pass :object
        s.object= self;
        UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:self];
    [self dismissModalViewControllerAnimated:YES];
         [self.navigationController pushViewController:s animated:YES];
        NSLog(@"self.nav%@",self.navigationController);
     }
4

2 に答える 2

0

ビューコントローラーのself.navigationController(モーダルに提示)はnilになります

ナビゲーションコントローラーオブジェクトを割り当てているため、このことに気付くことができません。

于 2013-05-27T14:50:42.360 に答える