In my Controller.h file...I listed the NSDictionary I am using along with the items to pull. But I'm having a problem identifying the Audio Recording Variable...
@property (nonatomic, retain) NSDictionary *dataForCurrentLevel;
@property (nonatomic, retain) IBOutlet UILabel *Name;
@property (nonatomic, retain) IBOutlet UILabel *Author;
@property (nonatomic, retain) IBOutlet UILabel *Time;
@property (nonatomic, retain) NSString *Recording;
In my Controller.m file....
- (void)viewDidLoad
{
// Configure the user interface by extracting the data from the dictionary
Name.text = [dataForCurrentLevel valueForKey:@"Name"];
Author.text = [dataForCurrentLevel valueForKey:@"Author"];
Time.text = [dataForCurrentLevel valueForKey:@"Time"];
//the above lines work AOK. The build pulls in and shows the data in my new view controller with no problems. However, I'm unable to pull in the audio m4a file that goes with the dictionary item. Using the below code, I can play one specific audio file...but how do I change the below code to pull in the audio file listed in the plist dictionary at the current table level? FYI, the audio file is listed with object key: "Recording" Type: "String" and a variable value like: "buzz.4ma"
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:@"buzz" ofType:@"m4a"]];
self.myPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL error:nil];
//How do I get pathForResource to choose the variable audio file in the plist dictionary?