Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

I have an app that allows users to download files and save them to the device's internal memory. I need to be able to display the total app disk usage at any given time. I found how to check the total device disk size and usage, but not specifically the app's disk usage. How would I go about getting that same value that can be seen in the Settings -> Usage screen for the app?

share|improve this question

1 Answer 1

You can use NSFileManager to examine files and directories. Just like with a desktop app, your app has access to its sandbox and the directory and files there. The most likely place you are saving files is in your apps Documents directory, so you can ask NSFileManager to iterate over the contents of that directory for the files you are interested in, and then get attributes (like size) of those files. It's all there in the docs.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.