Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 使用AVAudioRecorder录制m4a,然后将该声音文件放入.plist文件_Ios_Plist_Avfoundation_Avaudioplayer_Avaudiorecorder - Fatal编程技术网

Ios 使用AVAudioRecorder录制m4a,然后将该声音文件放入.plist文件

Ios 使用AVAudioRecorder录制m4a,然后将该声音文件放入.plist文件,ios,plist,avfoundation,avaudioplayer,avaudiorecorder,Ios,Plist,Avfoundation,Avaudioplayer,Avaudiorecorder,首先,我甚至不能得到一个我认为应该在下面工作的.plist。我只是想写一个NSNumber并检索它 self.paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); self.documentsDirectory = [self.paths objectAtIndex:0]; self.path = [self.documentsDirecto

首先,我甚至不能得到一个我认为应该在下面工作的.plist。我只是想写一个NSNumber并检索它

self.paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        self.documentsDirectory = [self.paths objectAtIndex:0];
        self.path = [self.documentsDirectory stringByAppendingPathComponent:@"data.plist"];
        self.fileManager = [NSFileManager defaultManager];
        NSError *error;
        if (![self.fileManager fileExistsAtPath:self.path]) {
            self.bundle = [[NSBundle mainBundle] pathForResource:@"data" ofType:@"plist"];

            [self.fileManager copyItemAtPath:self.bundle toPath:self.documentsDirectory error:&error];

        }

        self.dataForDict = [[NSDictionary alloc] initWithContentsOfFile:self.documentSlashAudioPath];
        int value = 5;
        [self.dataForDict setValue:[NSNumber numberWithInt:value] forKey:@"value"];
        [self.dataForDict writeToFile:self.path atomically:YES];

        self.number = [self.dataForDict objectForKey:@"value"];
        NSLog(@"%i", [self.number intValue]);
最后一个NSLog应该给我一个5,但是输出是0

我正在尝试创建一个.plist文件,其中包含音频,用于声音库播放器:

我知道如何用AVAudioRecorder和AVAudioPlayer录制声音并播放,现在我只需要连接点