I am creating a simple media player app. My App is crashed when first link is played and I clicked second link in uitableview.
- (void)viewDidLoad {
[s
It's wise to verify first if the key is being observed or not before removing the observer with a @try @catch
, like so:
@try {
[self.player removeObserver:self forKeyPath:@"status" context:nil];
} @catch (id anException) {
//do nothing, obviously it wasn't attached because an exception was thrown
NSLog(@"status key not being observed");
}