2010-04-09 8 views

답변

4
+(float)getTotalDiskSpaceInBytes { 
    float totalSpace = 0.0f; 
    NSError *error = nil; 
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
    NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error]; 

    if (dictionary) { 
     NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize]; 
     totalSpace = [fileSystemSizeInBytes floatValue]; 
    } else { 
     DLog(@"Error Obtaining File System Info: Domain = %@, Code = %@", [error domain], [error code]); 
    } 

    return totalSpace; 
} 
을 찾을 수가 기운이 않는다는 것을 알고있다
관련 문제