ビューにオーディオを録音し、親ビューにポップアウトした後に保存されたオーディオファイルを取得するにはどうすればよいですか?
ストーリーボードに埋め込まれたナビゲーションコントローラーを使用しています。
このコードは子ビューにあります。
NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsDir = [dirPaths objectAtIndex:0];
tempFilePath = [NSURL fileURLWithPath:[docsDir stringByAppendingPathComponent:[NSString stringWithFormat: @"record.%@", @"caf"]]];
NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];
audioRecorder = [[ AVAudioRecorder alloc] initWithURL:tempFilePath settings:recordSetting error:nil];
[audioRecorder setDelegate:self];
[audioRecorder prepareToRecord];
[audioRecorder record];
さて、どうすれば親コントローラーでそれを取得できますか?