gpt4 book ai didi

ios - 在 Objective-C 中检查数据库中空字符串的正确方法是什么

转载 作者:行者123 更新时间:2023-11-29 01:58:12 28 4
gpt4 key购买 nike

我想在数据库中行中没有数据时限制数据库而不是无法显示异常我只是想限制空值

  if ([[Utility checkNullValues:tInfo.product_price]isEqualToString:@""]) {
[Utility showAlertView:@"Sorry" message:@"No Product You Buy." viewcontroller:self];
}

这就是错误:

2015-06-03 12:35:38.320 NiColi[28363:2438247] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* +[NSString stringWithUTF8String:]: NULL cString' *** First throw call stack:

最佳答案

NSString *str = ((char *)sqlite3_column_text(compiledStatement, 1)) ? [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)] : nil;

关于ios - 在 Objective-C 中检查数据库中空字符串的正确方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30613699/

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