-remoteControlReceivedWithEvent: is not getting called
-remoteControlReceivedWithEvent: is not getting called
- Subject: -remoteControlReceivedWithEvent: is not getting called
- From: Steve Christensen <email@hidden>
- Date: Tue, 27 Jul 2010 11:50:24 -0700
I am trying to get remote control events to start/stop some audio my app is playing, but -remoteControlReceivedWithEvent: isn't getting called. My app has a tab bar that switches among multiple views, if that makes any difference.
The view controller for each view implements the setup per Apple's docs on using remote control events (https://developer.apple.com/iphone/library/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/RemoteControl/RemoteControl.html#//apple_ref/doc/uid/TP40009541-CH7-SW1). I've copied those bits below for reference.
Any ideas on why -remoteControlReceivedWithEvent: isn't getting called? Should I be implementing it on another object in the responder chain?
steve
- (BOOL) canBecomeFirstResponder
{
return YES;
}
- (void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self becomeFirstResponder];
}
- (void) viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[UIApplication sharedApplication] endReceivingRemoteControlEvents];
[self resignFirstResponder];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden