I am working on a database application using the Core Data framework. In this application I need to display how much data the application currently is using on the iPhone. Is there any way to do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I found this answer on the Apple Dev Forums to be useful for finding disk space available on the apps’ home directory partition (note there are currently two partitions on each device).
Use
NSPersistentStoreCoordinatorto get your store collection.Use
NSFileManagerto get each stores’ size in bytes(unsigned long long)Note that the code above is in a method of my app delegate, and it has a property
persistentStoreCoordinator.