以下文件已添加到我的项目中
FPPopoverController.m and .h (the controller)
FPPopoverView.m and .h
FPTouchView.m and .h
ARCMacros.h
按下UIBarButtonItem
-(IBAction)popover:(id)sender
{
NSLog(@"Method called");
//the view controller you want to present as popover
MenuViewController *controller = [[MenuViewController alloc] init];
//our popover
FPPopoverController *popover = [[FPPopoverController alloc]
initWithViewController:controller];
//the popover will be presented from the okButton view
[popover presentPopoverFromView:[sender valueForKey:@"view"]];
//no release (ARC enable)
//[controller release];
}
在按下UIBarButtonItem后,我看到了Log Method called
但没有显示popover view
在将我的项目转换为ARC之前,这是有效的。
问题是什么
答案 0 :(得分:0)
试试这个
UIBarButtonItem *item = sender;
UIView *btnView = [item valueForKey:@"view"];
[popover presentPopoverFromView:btnView];