ios - CoreData ManagedObjectContext Recursive Save Error -


some users of mine encountering coredata error when performing save. haven't been able find information online error or how symbolicate stack trace.

the error message attempt recursively call -save: on context aborted, stack trace, full error message below.

doe have hints or ideas on how figure out going wrong?

error domain=nscocoaerrordomain code=132001 "(null)" userinfo={message=attempt recursively call -save: on context aborted, stack trace=( 0   coredata                            0x0000000188cbe70c  + 164 1   primetime                           0x0000000100077ea4 primetime + 130724 2   primetime                           0x00000001000ae988 primetime + 354696 3   primetime                           0x0000000100081674 primetime + 169588 4   primetime                           0x00000001000802ac primetime + 164524 5   coredata                            0x0000000188d8bbd4  + 4568 6   coredata                            0x0000000188d8a9ec  + 124 7   corefoundation                      0x00000001869ac24c  + 20 8   corefoundation                      0x00000001869ab950  + 400 9   corefoundation                      0x00000001869ab6cc  + 60 10  corefoundation                      0x0000000186a187bc  + 1504 11  corefoundation                      0x00000001868ef32c _cfxnotificationpost + 376 12  foundation                          0x000000018738296c  + 68 13  coredata                            0x0000000188cc16e8  + 724 14  coredata                            0x0000000188d43ca4  + 1336 15  coredata                            0x0000000188cbfd04  + 2116 16  coredata                            0x0000000188cbe808  + 416 17  primetime                           0x0000000100077ea4 primetime + 130724 18  primetime                           0x0000000100089968 primetime + 203112 19  primetime                           0x00000001001d47c0 primetime + 1558464 20  libdispatch.dylib                   0x0000000186459058  + 24 21  libdispatch.dylib                   0x0000000186459018  + 16 22  libdispatch.dylib                   0x000000018645dbcc _dispatch_main_queue_callback_4cf + 1000 23  corefoundation                      0x00000001869bfc48  + 12 24  corefoundation                      0x00000001869bd834  + 1660 25  corefoundation                      0x00000001868ed764 cfrunlooprunspecific + 292 26  graphicsservices                    0x00000001882f0198 gseventrunmodal + 180 27  uikit                               0x000000018c8668d0  + 664 28  uikit                               0x000000018c86163c uiapplicationmain + 208 29  primetime                           0x00000001000ada1c primetime + 350748 30  libdyld.dylib                       0x00000001864905b8  + 4 

i had same problem xcode8/ios10. problem due call save core data context inside following method.

- (void)controllerdidchangecontent:(nsfetchedresultscontroller *)controller {     [self methodcallingsavecontext]; } 

the

methodcallingsavecontext 

calls save core data context. in order break recursive call rewrote method in following way:

- (void)controllerdidchangecontent:(nsfetchedresultscontroller *)controller {         dispatch_async(dispatch_get_main_queue(), ^{                [self methodcallingsavecontext];          }); } 

now working again.


Comments