Hi everyone,
I'm passing strings from one view to anothers buttons and image views but I've been stuck on how to pass a string to a mediaplayer.
I basically have several buttons in view1 that push in view2.
view2 has a mediaplayer and it needs to play a different audio file depending
on which button was pushed in view 1. I'm not entirely sure the best way to go about it or how to go about it for that matter.
Maybe passing a string to the second view and use a :@"%@", musicstring];
in the player?
I've been stuck for a few days, Please Help!
Here's the code for the first view-
- (IBAction)pressedb1view {
if (thebutton.tag==101) {
[self performSelector:@selector(dismissb1pop

withObject:nil afterDelay:0.1];
b1view.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:b1view animated:YES];
[b1view changeSiteText:@"my text"];
for the second view in the .h I have-
- (IBAction) changeSiteText

NSString *)str;
and in the .m-
- (IBAction) changeSiteText

NSString *)str{
lblSiteTxt.text = str;
}
-(void)viewWillAppear

BOOL)animated {
[[self navigationController] setNavigationBarHidden:NO animated:YES];
NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"music1" ofType:@"mp3"];
NSURL *url = [NSURL fileURLWithPath:urlStr];
//NSURL *movieURL = [NSURL URLWithString:self.movieURLTextField.text];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.view addSubview:moviePlayer.view];
moviePlayer.view.frame = CGRectMake(0, 0, 320, 40);
[moviePlayer play];
}