-2

i m saving more then 1 gb data in core data and arround 200000 records.and app getting exit each time on device not on simulator. so is there any size restriction on device?

        if (![context save:&error]) 
        {
            // Handle the error.
            //  NSLog(@"Error in saving copupons");
        }
        else
        {
            NSLog(@"Saved data");
        }

and getting proper message while saving data

Manish Jain
  • 865
  • 3
  • 13
  • 28
  • 2
    I would advise that you expand your question because you're not providing enough information for anyone to realistically help you. This usually leads to a protracted and frustrating round of requests in the comments for more information by other users who **really do want to help you**. For example, include in the question: code snippets/samples, the API you're using, stack traces, screen shots etc. When you've done this, flag to have your question re-opened. Please also take the time to [read this](http://tinyurl.com/so-hints). Thanks. – Kev Nov 17 '11 at 13:37

1 Answers1

3

...post your crash logs. You say 'getting exit each time', but your app must be logging some kind of warning. Although to be honest I'm not that surprised. 1GB of data to write into Core Data is a little bit insane, especially on a device that has very limited RAM and comparatively slow storage. It's very hard to give any opinion without knowing more, other than the fact that it sounds like the technical architecture of your app may need a serious rethink.

lxt
  • 31,146
  • 5
  • 78
  • 83
  • 1 gb data is coming from server and it get passing through arrays. is this is the correct way? basically data is all images – Manish Jain Nov 16 '11 at 16:25
  • 2
    I guess that just raises more questions! Personally, I don't think Core Data is a suitable method to store large images in. A better approach would be to use Core Data to store the image attributes and metadata (eg, file location), and save your images directly to disk. This question talks about why using Core Data for image storage might not be a great idea - http://stackoverflow.com/questions/2131722/coredata-for-iphone-storing-images – lxt Nov 16 '11 at 16:27