我做了這個函數返回的文件目錄中的文件的大小,它的工作原理,但我得到警告說,我要修復,功能:警告「fileAttributesAtPath:traverseLink被棄用:在IOS第一棄用2.0
-(unsigned long long int)getFileSize:(NSString*)path
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *getFilePath = [documentsDirectory stringByAppendingPathComponent:path];
NSDictionary *fileDictionary = [[NSFileManager defaultManager] fileAttributesAtPath:getFilePath traverseLink:YES]; //*Warning
unsigned long long int fileSize = 0;
fileSize = [fileDictionary fileSize];
return fileSize;
}
*警告是'fileAttributesAtPath:traverseLink:已棄用,先在ios 2.0中棄用'。這是什麼意思,我該如何解決它?
的可能的複製[?如何解決fileAttributesAtPath警告問題(http://stackoverflow.com/questions/9019353/how-to- resolve-issues-with-fileattributesatpath-warning) –