analyze正在subj中生成警告。
有什么建议吗?
const char *cString = [query UTF8String];
unsigned long long affectedRows;
if (self.sqlPut != NULL) {
mysql_query(self.sqlPut,cString);
affectedRows = mysql_affected_rows(self.sqlPut);
if (affectedRows == 0) NSLog(@"MYSQL: Query: %@ was failed with error:%s\n and error number:%d",query,mysql_error(self.sqlPut),mysql_errno(self.sqlPut));
}
else {
[self mysqlConnect];
if (sqlPut != NULL) {
mysql_query(self.sqlPut,cString);
affectedRows = mysql_affected_rows(self.sqlPut);
if (affectedRows == 0) NSLog(@"MYSQL: Query: %@ was failed with error:%s\n and error number:%d",query,mysql_error(self.sqlPut),mysql_errno(self.sqlPut));
}
}
NSNumber *affectedRowsNumber = [[[NSNumber alloc] initWithUnsignedLongLong:affectedRows] autorelease];
return affectedRowsNumber;
最佳答案
一个简单的办法是改变
unsigned long long affectedRows;
到
unsigned long long affectedRows = 0;
关于objective-c - 消息表达式中的参数是一个未初始化的值,无符号,长到NS号,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5571594/