I am using the FPPopover class which creates popups for iPhones. I followed the exact steps that are in the readme file but instead of using a UIbutton from a xib file, I am
I was getting the same error. Solution is to create a UIButton Programatically (at the same place of UIBar button item - set the appropriate coordinates) and then present popover from UIButton. Then hide the UIButton.
This code worked for me:
-(void)testMethod {
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
// set action as NULL if you dont need any method/functionality to call
[button addTarget:self action:@selector(aMethod)
forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Show View" forState:UIControlStateNormal];
button.frame = CGRectMake(130, -40, 160.0, 40.0);
[self.view addSubview:button];
AlertsViewController *controller = [[AlertsViewController alloc] init];
//our popover
FPPopoverController *popover = [[FPPopoverController alloc] initWithViewController:controller];
//the popover will be presented from the Button view
[popover presentPopoverFromView:button];
//hide the button
button.hidden = YES;
}
-(void)aMethod {
// Write any functionality if you need
}
Hope this helps. Let me know if you get any issue.