0

I am trying to find my iPhone application's disk usage. So i have tried finding the size of my application's home directory. But it does not give the correct value when i compare with usage shown in iPhone 4S Settings->Usage tab for the same application. I have used the following line s of code. Cane anyone says if i am going wrong anywhere or anyone can help me for finding the same.

NSString *path = NSHomeDirectory(); NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfItemAtPath:path error: &error]; NSNumber *appDiskSpaceInBytes = [dictionary objectForKey: NSFileSize];

float appDiskSpace = ([appDiskSpaceInBytes floatValue]/1024.0);

user1425958
  • 61
  • 1
  • 3

1 Answers1

0

Use 1000 while dividing not 1024. Then it will be in sync with what Usage shows.