I want to build Grouped View in Modal View which is destination state from "+" button on the Navigation bar in main table view.
I have written this code:
-(void)viewDidLoad
{
//title
self.title = @"Set";
//addBtn
UIBarButtonItem *addBtn = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(toggleEditing)];
self.navigationItem.rightBarButtonItem = addBtn;
[addBtn release];
}
-(IBAction)toggleEditing
{
}
create a subclass of UITableViewController
named MyTableViewController
use presentModalViewController:animated:
in your current viewController
-(IBAction)toggleEditing { MyTableViewController *tableViewController = [[[MyTableViewController alloc] initWithStyle:UITableViewStyleGrouped] autorelease]; [self presentModalViewController:tableViewController animated:YES]; }
And you will need a delegate method that tells the viewController from where you showed the modal viewcontroller that a row was selected.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.