iPhone modal view inside another modal view?

前端 未结 3 1922
夕颜
夕颜 2020-12-17 05:07

My App uses a modal view when users add a new foo. The user selects a foo type using this modal view. Depending on what type is selected, the user needs to be asked for more

3条回答
  •  清酒与你
    2020-12-17 05:52

    Fixed. I got the behavior I wanted by pushing the second view controller to the first view controller's UINavigationController.

    creation of 1st modal view

    FooAddController *addController = [FooAddController alloc]
        initWithNibName:@"FooAddController" bundle:nil];
    addController.delegate = self;
    addController.foo = newFoo;
    UINavigationController *navigationController = [[UINavigationController alloc]
        initWithRootViewController:addController];
    [self presentModalViewController:navigationController animated:YES];
    [addController release];
    

    creation of 2nd modal view (in FooAddController)

    FooAddSizeViewController *addSizeController = [[FooAddSizeViewController alloc]
        initWithNibName:@"FooAddSizeViewController" bundle:nil];
    addSizeController.delegate = self;
    addSizeController.foo = self.foo;
    [self.navigationController pushViewController:addSizeController animated:YES];
    [addSizeController release];
    

提交回复
热议问题