有时我在我的应用中遇到这种错误:
(3551,0xb0103000) malloc: *** error for object 0xd27ce60: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
(3551,0xb0353000) malloc: *** error for object 0x65676170: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
(3551,0xb0103000) malloc: *** error for object 0xd27cd40: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
(3551,0xb0353000) malloc: *** error for object 0x40640000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
(3551,0xb0103000) malloc: *** error for object 0xd27cc20: Non-aligned pointer being freed (2)
当我尝试将新信息插入sqlite时会发生这种情况:
if ( sqlite3_exec(databaseHandle, [insertStatement UTF8String], NULL, NULL, &error) == SQLITE_OK)//exception
{
return YES;
}
else{
{
databaseHandle对象是静态的,我在app启动时打开数据库:
sqlite3_open([databasePath UTF8String], &databaseHandle) == SQLITE_OK)
也许我错过了什么?
NSString *insertStatement = [NSString stringWithFormat:@"INSERT INTO INFORMATION (INFO) VALUES (\"%@\")",info];