0

我有以下代码:

- (IBAction)textOptionsTapped:(UIBarButtonItem *)sender {
    UIView *buttonView = [sender valueForKey:@"view"];

    FPPopoverController *popover = [[FPPopoverController alloc] init];
    popover.arrowDirection = FPPopoverArrowDirectionDown;
    [popover presentPopoverFromView:buttonView];
}

每次按下按钮时,究竟是什么导致我的应用程序 NSLog “FPPopoverController dealloc”?

4

1 回答 1

0

这是我在生产中工作的实现。试试这个。可能只是您没有正确设置所有属性。

// 实例化弹出框

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];

让我知道这是否有帮助

于 2014-04-14T17:24:57.920 回答