I initially added MPVolumeView dynamically to the page ...
#import "MediaPlayer/MPVolumeView.h"
.
.
-(IBAction) handleVolumeButtonClicked:(id) sender {
if (volumeView == nil) {
volumeView = [[MPVolumeView alloc] initWithFrame:CGRectMake(25, 378, 270, 30)];
[self.view addSubview:volumeView];
[volumeView release];
} else {
[volumeView removeFromSuperview];
volumeView = nil;
}
}
But for some reason, I started getting crash reports when dynamically adding a volume component.
To get around this, I decided to try adding the component to the view through the Xcode constructor, but then I realized that I did not know how to do it!
I first dragged the "Object" from the template into the "Object" panel, but then I found that I could not add it to the view. So I gave up on this idea and then dragged the "View" object directly onto the .xib view.
" " "MPVolumeView", . .
- , , , ?