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);