I have a heavy operation that needs access to the Address Book, so i put that operation into a thread. If the thread is still running, and then i push the Home button so that the app enters background, the app will crash. I look into the Crash log and it seems that when the app enters background, it can not access the Address Book anymore since it's a locked file system (i dont know why but it says so).
Here's the message from Crash log
My questions are :
- What's the correct way to do in this case ?
- If i put the operation in the main thread instead of a background thread, then when the app enters background, the operation still runs, and it doesn't crash at all. Why is there such situation ?
Here's the message from Crash log
Code:
AppName[5811] was suspended with locked system files:
/private/var/mobile/Library/AddressBook/AddressBook.sqlitedb
My questions are :
- What's the correct way to do in this case ?
- If i put the operation in the main thread instead of a background thread, then when the app enters background, the operation still runs, and it doesn't crash at all. Why is there such situation ?