tôi đã thực hiện chức năng này trả về kích thước của tập tin trong thư mục tài liệu, nó hoạt động nhưng tôi nhận được cảnh báo mà tôi muốn sửa chữa, chức năng:Cảnh báo 'fileAttributesAtPath: traverseLink được chấp nhận: đầu tiên bị phản đối ở 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;
}
* Cảnh báo là 'fileAttributesAtPath: traverseLink: không được dùng nữa lần đầu tiên trong ios 2.0'. Nó có nghĩa là gì và làm thế nào tôi có thể sửa chữa nó?
có thể trùng lặp của [? Làm thế nào để giải quyết vấn đề với cảnh báo fileAttributesAtPath] (http://stackoverflow.com/questions/9019353/how-to- giải quyết-vấn đề-với-fileattributesatpath-cảnh báo) –