UIPopoverController 是针对iPad开发的类
先建一个内容控制 SecondTableViewController
然后在 ViewController.m中
#import "ViewController.h"
#import "SecondTableViewController.h"
#import "ThirdViewController.h"
@interface ViewController ()<UIPopoverControllerDelegate>
@property (nonatomic,strong) UIPopoverController *popoverVC;
@property (nonatomic,strong) SecondTableViewController *secondVC;
@property (nonatomic,strong) NSArray *array;
@property (nonatomic,strong) NSArray *array1;
@property (nonatomic,strong) UIView *viewTry;
@end
@implementation ViewController
- (void)viewDidLoad {
[superviewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.view.backgroundColor = [UIColorgrayColor];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItemalloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarkstarget:selfaction:@selector(leftBarButtonItemDidPress:)];
// 按钮
UIButton *button = [UIButtonbuttonWithType:UIButtonTypeSystem];
button.frame = CGRectMake(0, 0, 100, 100);
button.center = self.view.center;
button.backgroundColor = [UIColorblueColor];
[button setTitle:@"弹窗"forState:UIControlStateNormal];
button.titleLabel.font = [UIFontboldSystemFontOfSize:40];
[button addTarget:selfaction:@selector(buttonDidPress:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:button];
//数组
self.array =@[@"1