내 Controller.h 파일에서 ... 끌어 오기 항목과 함께 사용하고있는 NSDictionary를 나열했습니다. 하지만 ... 내 Controller.m 파일에서오디오 파일을 Plist에서 재생
@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;
... // 위의 라인이 AOK 작업
- (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"];
을 오디오 녹음 변수를 식별하는 데 문제가 있어요. 빌드가 문제없이 새로운 뷰 컨트롤러의 데이터를 가져와 보여줍니다. 그러나 사전 항목과 함께 사용되는 오디오 m4a 파일을 가져올 수 없습니다. 아래 코드를 사용하면 하나의 특정 오디오 파일을 재생할 수 있지만 현재 표 수준에서 plist 사전에 나열된 오디오 파일을 가져 오기 위해 아래 코드를 어떻게 변경합니까? "기록"유형 : "문자열"과 같은 변수 값 : 참고로, 오디오 파일은 객체 키를 나열됩니다 "buzz.4ma"
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:@"buzz" ofType:@"m4a"]];
self.myPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL error:nil];
// 나는 pathForResource 변수 오디오 파일을 선택하려면 어떻게합니까 plist 사전에?