2013-02-16 75 views
0

我嘗試記錄AAC型 語音文件,並顯示在uitable和工作不錯,但我不能在iTunes文件顯示共享IOS,iTunes的文件共享保存音頻文件

我激活了UIFIleSharingEnabled

但我不能看在iTunes文件共享我可以做的AAC文件?

文件格式AudioformatMPEG4AAC

fileaddres:文件://本地主機/用戶/爲myuser/.. .AAC

保存部

NSArray *keys = [NSArray arrayWithObjects:@"voicestr",,@"datestr",@"durstr",nil]; 

NSDictionary * HistDict =[[NSDictionary alloc] initWithObjects: [NSArray arrayWithObjects:myString,timeString,dateString,currentimeLbl.text,bestsize ,nil] forKeys:keys]; 

[Hist addObject:HistDict]; 

載荷文件

BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:myPath];if (fileExists) 
    HistValue = [[NSMutableArray alloc] initWithContentsOfFile:myPath]; 
+0

文件共享該文件必須是存儲在'Documents'目錄中。 – rmaddy 2013-02-16 20:46:44

+0

好的 如果你可以幫我存儲在documet目錄下的這段代碼? AAC文件的 – user1466308 2013-02-16 20:58:00

+0

在'NSDocumentDirectory'上執行搜索。你會發現很多樣本。 – rmaddy 2013-02-16 21:06:03

回答

1

你得到的文檔目錄適用於iOS用這種方法:

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

NSString *basePath = [paths objectAtIndex:0] 

添加文件名

NSString *fielWithPath = [basePath stringByAppendingPathComponent:@"fileNaem"]; 

而且你必須能夠在info.plist

UIFileSharingEnabled = YES