iOS开发 文件存储

 

NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];

 NSString *voicePath = [cachePath stringByAppendingPathComponent:@"VoiceFiles"];

- (NSString *)voiceName

{

    if (_voiceName == nil) {

        NSString *filename = [[NSDate date] stringValue];

        filename = [filename stringByReplacingOccurrencesOfString:@" " withString:@"_"];

        _voiceName = [filename stringByAppendingString:@".caf"];

    }

    return _voiceName;

}

- (NSString *)voiceFilePath

{

    NSLog(@"%@", self.voiceName);

    if (self.voiceName) {

        return [[NSString voiceDirectoryPath] stringByAppendingPathComponent:self.voiceName];

    }

    return nil;

}

 

语音存储路径/var/mobile/Containers/Data/Application/8895A877-6F33-4CBB-9EE3-417CE2A9601A/Documents/VoiceFiles/2016-11-22_09:54:13.caf

 

参考链接http://blog.csdn.net/xingxing513234072/article/details/24184917

posted @ 2016-11-22 10:07  三年幻想郷  阅读(177)  评论(0编辑  收藏  举报