Saturday, May 25, 2013

UIApplication endReceivingRemoteControlEvents example in objective c(iOS)


UIApplication endReceivingRemoteControlEvents

Tells the application to stop receiving remote-control events.
- (void)endReceivingRemoteControlEvents
Discussion
Remote-control events originate as commands issued by headsets and external accessories that are intended to control multimedia presented by an application.
UIApplication endReceivingRemoteControlEvents example.

-(void)viewWillDisappear:(BOOL)animated{
[[UIApplication sharedApplication] endReceivingRemoteControlEvents];
[self resignFirstResponder];
[super viewWillDisappear:animated];
}

UIApplication endReceivingRemoteControlEvents example.
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [[UIApplication sharedApplication] endReceivingRemoteControlEvents];
    [self resignFirstResponder];
}
UIApplication endReceivingRemoteControlEvents example.

-(void)viewWillDisappear:(BOOL)animated {
[[UIApplication sharedApplication] endReceivingRemoteControlEvents];

[self resignFirstResponder];
[super viewWillDisappear:animated];
}