iphone 设置iTunes共享目录

在Info.plist里添加一行配置信息即可

设置Application supports iTunes file sharing为YES.

以下是返回该目录下文件路径的代码:

 

-(NSString*)shareFilePath:(NSString*)filePath {

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);

    NSString *documentsDirectory = [paths objectAtIndex:0];

    return [documentsDirectory stringByAppendingPathComponent: filePath];

}

执行方法[xxx shareFilePath:@"Data.Index"]即可返回该目录下Data.Index的绝对路径。

 
posted @ 2012-05-21 16:48  翛尧  阅读(515)  评论(0编辑  收藏  举报