I am trying to save data to the main data in a background thread, as it takes quite a lot of time to save.
I did:
[self performSelectorInBackGround:@selector(insertRecord:) withObject:data]
When everything works fine until the line in the insertRecord
Method hits contextsave:&error
. Program Signal: "SIGABRT"
Am I doing something wrong? it works fine when it is in the main thread, I just move the codes to another method and run it in the background and it no longer works.
source share