I have the following code, but it doesn’t display the route button.
MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:CGRectZero];
volumeView.showsRouteButton = YES;
volumeView.showsVolumeSlider = NO;
[volumeView sizeToFit];
[self.view addSubview:volumeView];
[volumeView release];
In the documentation I read:
The route button is visible by default when there is more than one audio output route available.
I only have one audio output, so the button doesn’t show. Is there any way to simulate multiple audio outputs so that I can test this button?
Since some time has past and I still haven’t gotten any correct answers, I thought I would share how to solve this problem without buying an Apple TV or other air play device.
The way I solved it was simply to use a bluetooth headset, which costs much less than an Apple TV.
Another suggested way to solve it is to use AirView on another iOS device. I haven’t tested this, but judging from the comments it doesn’t support sound, so I don’t think it works.
I intend to accept this as my answer, but I will change my accept if anyone finds a real way to simulate multiple audio outputs.