Open DenDoronin opened 10 years ago
This should be fixed in the fork I'm maintaining.
On Tue, Oct 21, 2014 at 8:09 PM, DenDoronin notifications@github.com wrote:
Hi, I'm getting this error on the next case:
- i show popover on button press, where i used presentPopoverFromRect: inView: permittedArrowDirections: animated:
- dissmiss popover with [self.customPopoverController dismissPopoverAnimated:YES]; self.customPopoverController = nil;
if i open and than close popover for many times (just click button as faster as i can), it crushes on addObserver method full method's code:
- (void)showPopoverWithControllerByStroryBoardName: (NSString) name fromView: (UIView) view delegate: (id
) delegate permittedArrowDirections:(WYPopoverArrowDirection)aArrowDirections withContext:(id) context{ if (!self.customPopoverController) { UIViewController *contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:name]; if (!self.storyboard) { // init from nib contentViewController = [[UIViewController alloc] initWithNibName:name bundle:nil]; }
if (context && [contentViewController respondsToSelector:NSSelectorFromString(@"model")]) [contentViewController setValue:context forKeyPath:@"model"]; if ( [contentViewController respondsToSelector:NSSelectorFromString(@"delegate")]) [contentViewController setValue:self forKeyPath:@"delegate"]; self.customPopoverController = [[WYPopoverController alloc] initWithContentViewController:contentViewController]; if (self.popoverContentSizeHeight > 0 && self.popoverContentSizeWidth >0) self.customPopoverController.popoverContentSize = CGSizeMake(self.popoverContentSizeWidth, self.popoverContentSizeHeight); self.customPopoverController.delegate = delegate; self.customPopoverController.theme.fillTopColor = [UIColor whiteColor]; self.customPopoverController.theme.outerShadowColor = [UIColor darkGrayColor]; self.customPopoverController.theme.outerShadowBlurRadius = 6.0; self.customPopoverController.theme.outerCornerRadius = 4.0; self.customPopoverController.theme.innerCornerRadius = 2.0; self.customPopoverController.theme.borderWidth = 0.0; [self.customPopoverController presentPopoverFromRect:view.bounds inView:view permittedArrowDirections:aArrowDirections animated:YES];
} else { [self.customPopoverController dismissPopoverAnimated:YES]; self.customPopoverController = nil; }
}
Reply to this email directly or view it on GitHub: https://github.com/nicolaschengdev/WYPopoverController/issues/144
great, thanks!
Hi, I'm getting this error on the next case:
full method's code:
(void)showPopoverWithControllerByStroryBoardName: (NSString) name fromView: (UIView) view delegate: (id) delegate
permittedArrowDirections:(WYPopoverArrowDirection)aArrowDirections
withContext:(id) context{
if (!self.customPopoverController) { UIViewController *contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:name]; if (!self.storyboard) { // init from nib contentViewController = [[UIViewController alloc] initWithNibName:name bundle:nil]; }
} else { [self.customPopoverController dismissPopoverAnimated:YES]; self.customPopoverController = nil; } }