title: How to detect total available/free disk space on the iPhone/iPad device?
body: <p>I'm looking for a better way to detect available/free disk space on the iPhone/iPad device programmatically.<br>
  Currently I'm using the NSFileManager to detect the disk space. Following is the snippet of the code which does the job for me:<br></p>
  
  <pre><code>-(unsigned)getFreeDiskspacePrivate {
  NSDictionary *atDict = [[NSFileManager defaultManager] attributesOfFileSystemForPath:@"/" error:NULL];
  unsigned freeSpace = [[atDict objectForKey:NSFileSystemFreeSize] unsignedIntValue];
  NSLog(@"%s - Free Diskspace: %u bytes - %u MiB", __PRETTY_FUNCTION__, freeSpace, (freeSpace/1024)/1024);
  
  return freeSpace;
  }
  </code></pre>
  
  <p><br>
  Am I correct with the above snippet? or is there any better way to know total available/free disk space.<br>
  I've to detect total free disk space, since we've to prevent our application to perform sync in the low disk space scenario.
  <br></p>