Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私のアプリは、ユーザーがオフラインでコンテンツを読むことができるようにコンテンツをキャッシュしています。
すべてのキャッシュをiPhoneのデータベースファイル(CoreDataを使用)に書き込みました。
ただし、iphoneではストレージサイズに制限があります。そこで、アプリが使用しているディスクサイズを制御したいと思います。
使用しているディスクサイズを確認するにはどうすればよいですか?
ありがとう
最も単純で最も正確な解決策は、永続ストアのサイズを直接チェックすることです。
-[NSFileManager attributesOfItemAtPath:error:]次に、fileSize返された辞書のキーを使用します。
-[NSFileManager attributesOfItemAtPath:error:]
fileSize