问题
I have the following code:
- (IBAction)textOptionsTapped:(UIBarButtonItem *)sender {
UIView *buttonView = [sender valueForKey:@"view"];
FPPopoverController *popover = [[FPPopoverController alloc] init];
popover.arrowDirection = FPPopoverArrowDirectionDown;
[popover presentPopoverFromView:buttonView];
}
What exactly is causing my app to NSLog "FPPopoverController dealloc" every time I press the button?
回答1:
Here's my implementation that's working in production. Try this out. It may just be that you haven't set all the properties correctly.
// Instantiate popover
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
LoginViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
if (self.popover) {
[self.popover dismissPopoverAnimated:NO];
self.popover = nil;
}
self.popover = [[FPPopoverController alloc] initWithViewController:viewController];
self.popover.contentSize = viewController.size;
self.popover.border = NO;
self.popover.arrowDirection = FPPopoverNoArrow;
self.popover.tint = FPPopoverRedTint;
[self.popover presentPopoverFromView:self.loginButton];
Let me know if that helps
来源:https://stackoverflow.com/questions/15671963/fppopover-wont-pop-up-on-button-press-just-nslogs-fppopovercontroller-dealloc