我想在数据库中行中没有数据时限制数据库而不是无法显示异常我只是想限制空值
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/