Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
I'm trying to restore 3000 contacts on a device, since i need to display a progress UI, I had to use something like this (SenchaTouch 2 code but you get the point).
[CODE]
//forEach contacts as contact...
_.delay(function() {
contact.save({callback : function(contact, operation) {
d&&console.log(displayName + ' ~ saved ('+ action +') contact', arguments);
j++;
App.getViewport().mask(
);
// Last item ?
if(j == count)
}});
}, 25*i);
[/CODE]
Works quite well in the simulator but i'm getting regular "failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode" on a device.
Major issue is that UI gets stuck for minutes.
Then i get a few "Received memory warning."
As if somehow the memory stacked somewhere (but the whole point of making separate call was to avoid memory breakdown), so there might be a leak.
At the end, it sometimes work / crash.
Would there be a way to somehow use another thread for theses AddressBook operations?
How could i prevent theses memory leaks?