Hello all this is my first post here i have been working in an iphone application it sound like a small music instrument i've used this code to load my music notes :
// get the path of the sound file
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"do"
ofType:@"mp3"];
// create a URL with the given path
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:soundPath];
// initialize the AVAudioPlayer with the sound file
btn_do = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL
error:nil];
[fileURL release];
and so on for all other notes (re,me,fa,sol,la,ci)
my question : is this method right because i have to write this code almost 16 times is there any better or stay like I am. Thanks