i would like to create a function called "playSound" with one (but later two parameters - one, which is the filename and one, which is the musictype (mp3,...))
but i cant get the paramter working in my function...please help me
here's my code
// // MainView.m // // Created by Christopher Fuchs on 26.01.11. // Copyright 2011 __MyCompanyName__. All rights reserved. // #import "MainView.h" #import <AVFoundation/AVAudioPlayer.h> #import <AVFoundation/AVFoundation.h> @implementation MainView void playSound(char filename){ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Mein Alert" message:filename delegate:nil cancelButtonTitle:@"Abbrechen" otherButtonTitles:nil]; [alert show]; [alert release]; } - (IBAction)PlayFatGuyWalking:(id)sender { playSound(@"MusicFile"); } @end For now, i just added an alert instead of the playing sound framework the paramater is called "filename" and should be called as message of the alert
thanks in advance
greez