我正在使用Core Data来管理数据库到我的应用程序中。CoreData Application在执行提取请求时冻结pthread_mutex_lock
我不能在这里发布代码,因为它太长。但我想我可以用一小段代码解释我的问题以及一些快照。
+(NSArray *)checkusernameandpassword:(NSString *)entityname username:(NSString *)username password:(NSString *)password
{
managedobjectcontext=[Singleton sharedmysingleton].managedobjectcontext;
NSEntityDescription *entity=[NSEntityDescription entityForName:entityname inManagedObjectContext:managedobjectcontext];
NSFetchRequest *request=[[NSFetchRequest alloc] init];
[request setEntity:entity];
NSPredicate *predicates=[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"userName==\"%@\" AND password==\"%@\"",username,password]];
[request setPredicate:predicates];
//On Below line, My app frezes and goes into deadlock, this happens randomly while performing
//some data request using Core data
NSArray *arrayofrecord=[managedobjectcontext executeFetchRequest:request error:nil];
return arrayofrecord;
}
我试图连接的呼叫组的一些屏幕截图(这些我看到在我暂停应用程序) 与图像中的选中标记的方法,在此僵局上述 提到发生
你好@AlexTerente,你能不能考虑看看[本问题](http://stackoverflow.com/questions/23504936/core-data-executefetchrequest-冻结应用程序中的后台线程)并告诉我您的解决方案是否也适用于此? – mirx 2014-05-07 07:47:56