LeoNatan / LNPopupController

A framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.
MIT License
3.04k stars 342 forks source link

Crash on removeObserver. #408

Closed iDevelopper closed 4 years ago

iDevelopper commented 4 years ago

Description

The framework crash on

[self.popupContentView removeObserver:self forKeyPath:@"popupCloseButtonStyle"];

in

- (void)dismissPopupBarAnimated:(BOOL)animated completion:(void(^)(void))completionBlock

in the console:

2020-09-03 08:00:37.307128+0200 LNPopupControllerExample[60321:4629177] *** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <LNPopupController 0x7fdda2f21990> for the key path "popupCloseButtonStyle" from <LNPopupContentView 0x7fdda2f21f20> because it is not registered as an observer.'

Steps to Reproduce

Run the Demo - Testing Scene (Objective-C), Navigation Controller, tap Dismiss Bar on the toolbar. Run the Demo - Music Scene, present the popup bar by selecting a song, wait for the end of the song.

Device, OS and Xcode Versions

iOS 14, Xcode 12.6, LNPopupController v.2.10.7. All simulators or devices.

LeoNatan commented 4 years ago

Oops Thanks!