iOS 5 Core Data freeze

前端 未结 7 895
清歌不尽
清歌不尽 2021-01-30 22:48

I try to do the following simple thing:

NSArray * entities = [context executeFetchRequest:inFetchRequest error:&fetchError];

Nothing fancy.

相关标签:
7条回答
  • 2021-01-30 23:34

    In my case the app would freeze before 'executeFetchRequest' without any warning. The solution was to wrap all db operations in @synchronized(persistentStore). Eg:

    NSArray *objects;
    @synchronized([self persistentStoreCoordinator]) {
                objects = [moc executeFetchRequest:request error:&error];
    }
    
    0 讨论(0)
提交回复
热议问题