Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 访问数据库时应用程序崩溃_Iphone_Ios_Memory Management - Fatal编程技术网

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中释放的变量,并确保您的各个线程没有同时释放同一个变量。