问题描述:

i had learned objective C 2 weeks ago, i get a project to front end, and i had stuck with one problem. I have my own class instead of default UITableView. With help of these class was created controller, let it be UniversalViewNavigationController, which show some table with content in cells, and i have a MainViewController where these cells show in popover. I need to show these tableView like simple table view, in my view, not in popover, how can i do these?

P.S. Sorry for my English, i hope you understand me :)

How it init's now

MainController

.h file

UIPopoverController *objectsTableViewPopover;

.m file, ViewDidLoad

 UniversalViewNavigationController *tablePopoverVC = [[UniversalViewNavigationController alloc] initWithTableSize:CGSizeMake(300, 550)];

tablePopoverVC.delegate = self;

objectsTableViewPopover = [[UIPopoverController alloc] initWithContentViewController:tablePopoverVC];

objectsTableViewPopover.popoverContentSize = tablePopoverVC.viewSize;

and IBAction

-(IBAction)navigationButtonClick:(id)sender

{

UIButton *tappedButton = (UIButton *)sender;

[objectsTableViewPopover presentPopoverFromRect:tappedButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];

}

网友答案:

Just do this

[mainViewController.view addSubView:exampleViewController.view];

You may need to adjust the frame.

网友答案:
UIView *view = exampleViewController.view; // or exampleViewController.tableView;
[mainViewController.view addSubView:view];
相关阅读:
Top