I have a rather basic game that runs on iOS. The only persistent data I store is an integer representing the high score, however upon running the app, I noticed it stores around 6 MB of data.
Does anyone know what exactly it stores in those 6 MB of data?
Related
I'm using Core Data for data storage. The data contains just 3 records, and columns contain just short strings. But 'Instruments' shows 4.02 MiB allocated by "VM: Core Data Object IDs".
It can be reproduced even in new Master-Detail project created by xcode wizard. After a single row is added, Core Data allocates those 4 MB.
It seems like some minimal memory chunk that is always allocated. Can it be reduced? I want to use it in Today widget, so memory usage is important.
In more detail, last time I tried releasing updates of my app when it had thousands of files in local storage took hours because the iPad had to transfer the sandboxed files in the app's private directory over to the new app. The time required was proportional to the number of files, not the amount of data in the files. So as a workaround I built my app around a small number of very large database files, Core Data in some cases and sqlite databases in other cases. Unfortunately, the time required to store the data in those databases is also huge and swamps the network transfer time of the raw data.
Now in iOS 8 is there a way to store a large tree of directories (5+ gigabytes of data) external to the app so that it doesn't have to be copied every time the app is updated?
You could probably use iCloud storage.
I am making a some complex app, in which every detail is imp. i have some questions
1. how much storage limit we have, if we plan to save big files on core data/cache.
2. Whats the RAM limit on iphone? Actually searching for some table that can give detailed info about IOS devices on this. Because i need to handle memory warnings and defend App crashes.
3. Its better to save images in cache or core data, assume you have a lot of images approx. 200-250.
Thanks
1) I am not aware of any storage limit. Obviously, you will never get 64GB or more - since no device is larger ;-). My wife's facebook app consumes >5GB at the moment... I suppose they did something wrong. The only important point is to fail gracefully (show a dialog, clean some space, ...) if the storage is full.
2) The RAM limit varies depending on the iPhone model and the currently running applications. Also there are some iPods with less memory in market. 30MB should be pretty safe. Total physical memory of the device can be retrieved as described here while retrival of the available RAM can be derived from that question.
3) Maybe this is a good starting point. I would always write image data to the file system and just store the file name inside the database, as suggested here.
I'm currently working on a concept for a new iPhone app, the would involve some very basic profile system.
Since all the other data will be stored in iCloud, I was wondering if it would be possible to store pictures in the cloud too.
I see that the storage per app is only 1MB, so this seems extremely low to store pictures.
The 1 MB limit is for Key-Value storage only (and KV storage is inappropriate for images for other reasons, too). If you use the Documents in the Cloud APIs, your app can store a large number of large files, limited only by how much space the user has (or hasn't) paid for. (Though it's wise to use that space judiciously and efficiently, as your potential customers won't be happy if your app alone causes them to blow the storage limits on their account.)
How to Store Large size Images into iPhone Application?
Images are taken from UIImagePickerController but saving into Database and retrieving from
Database crash the application.
If your images are large enough, then you should NOT store them inside Sqlite. Instead, you should simply store in the database the pathname where you actually save the image in the filesystem (say for example the Documents directory of your application).
Now, it is up to you to decide what is large enough. To me, binary data greater than 1 megabyte is large enough to decide not to store the data inside the database. The threshold is dictaed by practical consideration related to the speed of both Sqlite and the filesystem.