nicolaschengdev / WYPopoverController

WYPopoverController is for the presentation of content in popover on iPhone / iPad devices. Very customizable.
Other
1.94k stars 370 forks source link

NSInternalInconsistencyException when presentPopoverFromRect #145

Open finddoc opened 9 years ago

finddoc commented 9 years ago

*\ Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7fb51bf83970 of class DoctorLocationAddrPopoveredViewController was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x7fb51b9d86c0> ( <NSKeyValueObservance 0x7fb51b9d7760: Observer: 0x7fb51e5bcc30, Key path: preferredContentSize, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x7fb51e9b0130> )'

Generated when: Calling in dispatch_async OR preformSelectorInMainThread

Generated by:
[viewController removeObserver:self forKeyPath:NSStringFromSelector(@selector(preferredContentSize))]; and ... [strongSelf->viewController addObserver:self forKeyPath:NSStringFromSelector(@selector(preferredContentSize)) options:0 context:nil];

Generated in: iOS 8 both sim and actual device.

rsanchezsaez commented 9 years ago

Please, check if this is an issue on sammcewan's fork (which is actively maintained), and report it there if it is. Thanks.

matanume commented 9 years ago

It occur for me too. The reason is observer adding double called after animation done but the observer removing call only once when controller do dismiss.

diegothucao commented 9 years ago

How to fix the bug?

chunta commented 7 years ago

I just turn off animation, popover works well in this repo.