我正在尝试实施一个下拉菜单并找到了这个:iOSPullDownMenu
我按照描述完成了将下拉菜单添加到我的一个视图中。但是,每当我使用下拉菜单进入页面时,应用程序都会退出
[PulldownMenu setTranslatesAutoresizingMaskIntoConstraints:]:看不到实例的无法识别的选择器。
我不知道如何解决这个问题,我们将不胜感激。
这是我的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
pulldownMenu = [[PulldownMenu alloc] initWithView:self.view];
[self.view addSubview:pulldownMenu];
[pulldownMenu insertButton:@"Menu Item 1"];
[pulldownMenu insertButton:@"Menu Item 2"];
[pulldownMenu insertButton:@"Menu Item 3"];
pulldownMenu.delegate = self;
[pulldownMenu loadMenu];
[[self navigationController] setNavigationBarHidden:YES animated:YES];
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage
imageNamed:@"login_bg.png"]];
CGRect frame1 = CGRectMake(20, 20, 100.0, 100.0);
self.button1 = [UIButton buttonWithType:UIButtonTypeSystem];
self.button1.frame = frame1;
self.button1.layer.cornerRadius = 10;
self.button1.clipsToBounds = YES;
[self.button1 addTarget:self action:@selector(btn1Pressed:)
forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.button1];
}
-(IBAction)menuTap:(id)sender
{
[pulldownMenu animateDropDown];
}
这是错误:
-[PulldownMenu setTranslatesAutoresizingMaskIntoConstraints:]: unrecognized selector sent to instance 0x9177360
2014-01-23 13:42:47.174 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PulldownMenu setTranslatesAutoresizingMaskIntoConstraints:]: unrecognized selector sent to instance 0x9177360'