Iphone 访问数据库时应用程序崩溃
在我的应用程序中,我在后台访问数据库并将数据发送到服务器。为此,我们使用Iphone 访问数据库时应用程序崩溃,iphone,ios,memory-management,Iphone,Ios,Memory Management,在我的应用程序中,我在后台访问数据库并将数据发送到服务器。为此,我们使用NSThread方法 [NSThread detachNewThreadSelector:@selector(repeatedMethod) toTarget:self withObject:nil]; 这将导致应用程序崩溃,并出现以下错误: malloc:error for object 0xc53c200:double free在malloc\u error\u break中设置断点以进行调试当您两次释放某个变量(很可
NSThread
方法
[NSThread detachNewThreadSelector:@selector(repeatedMethod) toTarget:self withObject:nil];
这将导致应用程序崩溃,并出现以下错误:
malloc:error for object 0xc53c200:double free在malloc\u error\u break中设置断点以进行调试
当您两次释放某个变量(很可能是类级变量)时,会发生这种情况。可能它与线程无关。检查您在repeatedMethod中释放的变量,并确保您的各个线程没有同时释放同一个变量。