当我试图插入数据到我的表,有时我得到这个错误,我的应用程序崩溃!SQLite错误:EXC_BAD_INSTRUCTION(code = EXC_I386_INVOP,子代码= 0x0)-iOS
请先解决我的问题。
崩溃日志:
Observation(4001,0x10dd67000) malloc: *** error for object 0x7fff3a917100: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
2016-11-03 11:12:03.063 Observation[4001:46477] Insertion failed !
Printing description of dbpath:
(const char *) dbpath = 0x00007fff3b8a5690 "/Users/macbt/Library/Developer/CoreSimulator/Devices/0EEC62AE-6DF0-4FC4-9D30-1EB90CB695A5/data/Containers/Data/Application/A709E729-3162-4CC8-B9FF-2F22A32FC6BD/Documents/ObservationDB.db"
Printing description of insertSQL:
insert into table_hazard (id, name, modifiedDate) values ("1","Hazard", "03/11/2016 11:12:03 AM")
Printing description of insert_stmt:
(const char *) insert_stmt = 0x00007fff3b9291a1 "insert into table_hazard (id, name, modifiedDate) values (\"1\",\"Hazard\", \"03/11/2016 11:12:03 AM\")"
你在做后台线程任何DB操作? – KrishnaCA
雅,我取在背景数据,,,,和下此块在数据库 存储“dispatch_async(dispatch_get_main_queue(),^ { });” – Dhiru
是否有任何数据库操作在并行线程中去。我认为这可能是由于在不同的线程同时访问数据库 – KrishnaCA