So, I am making an iphone application that has only a thousand records that I read from an xml file into the main data. But inserting these records takes 10 seconds on the device. This is pretty funny.
The scheme is very simple, just one table. Ie, no relationship or anything else.
To understand what I mean, you can simply go to:
1. File β New project β Navigation application (make sure to use βUse basic dataβ)
2. Now inside RootViewController.m go to 'viewDidLoad' and in At the end of this method add:
for (int n = 0; n < 1000; n++) [self insertNewObject];
And just run the application. Even in the simulator, it takes 5 seconds, and on devices - twice as slow. Any ideas?
source
share