gpt4 book ai didi

iphone - 调试程序收到信号 "SIGABRT"

转载 作者:行者123 更新时间:2023-11-29 11:18:38 27 4
gpt4 key购买 nike

NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
NSString *aDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
NSString *aImageUrl = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
NSString *aCount = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)];
Animal *animal = [[Animal alloc] initWithName:aName description:aDescription url:aImageUrl countc:aCount ];

程序在设置“*aCount”的行接收到信号“SIGABRT”,我该如何调试(解决)这种类型的错误?

最佳答案

似乎数据库列的值为空。在处理 sqlite 时,您需要先检查 null 后再使用。

做这样的事情 -

if ((char *)sqlite3_column_text(compiledStatement, 4))
{
NSString *aCount = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)];

}

关于iphone - 调试程序收到信号 "SIGABRT",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8268409/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com