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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to