FMResult 中管理数据库值得学习的代码
来源:互联网 发布:linux查看hba卡信息 编辑:程序博客网 时间:2024/05/20 00:14
FMResult 中管理数据库值得学习的代码
- (NSDictionary *)resultDict {
int num_cols =sqlite3_data_count(statement.statement);
if (num_cols > 0) {
NSMutableDictionary *dict = [NSMutableDictionarydictionaryWithCapacity:num_cols];
int i;
for (i = 0; i < num_cols; i++) {
constchar *col_name = sqlite3_column_name(statement.statement, i);
if (col_name) {
NSString *colName = [NSStringstringWithUTF8String:col_name];
id value = nil;
// fetch according to type
switch (sqlite3_column_type(statement.statement, i)) {
case SQLITE_INTEGER: {
value = [NSNumbernumberWithLongLong:[selflongLongIntForColumnIndex:i]];
break;
}
case SQLITE_FLOAT: {
value = [NSNumbernumberWithDouble:[selfdoubleForColumnIndex:i]];
break;
}
case SQLITE_TEXT: {
value = [self stringForColumnIndex:i];
break;
}
case SQLITE_BLOB: {
value = [self dataForColumnIndex:i];
break;
}
}
// save to dict
if (value) {
[dict setObject:value forKey:colName];
}
}
}
return [[dict copy]autorelease];
}
else {
NSLog(@"Warning: There seem to be no columns in this set.");
}
return nil;
}
- FMResult 中管理数据库值得学习的代码
- 值得学习的一段代码
- 张艺谋是个值得学习的管理大师
- 值得学习的nonquery()代码
- 数据库管理,你值得拥有
- HTML5代码学习:值得收藏的HTML5代码片段
- 值得创始人学习的五大企业文化管理方式
- 值得创始人学习的五大企业文化管理方式
- 值得收藏的代码
- 【oracle学习】数据库存储管理中遇到的问题
- Java中常用的代码汇总(值得收藏的)
- Java中常用的代码汇总(值得收藏的)
- 还是值得学习的
- 值得学习的BOLG
- 值得学习的产品
- 值得学习的网站
- 值得学习的源代码
- 值得学习的博客地址
- 我积累了这么多文章了?
- Android Camera 调用流程
- 中央处理器CPU
- 机器视觉牛人
- js设置cookie
- FMResult 中管理数据库值得学习的代码
- Verilog HDL in one day Part-III
- Robberies
- 看懂信息检索和网络数据挖掘领域论文的必备知识总结
- 全排列算法c++实现
- 记录几个常用的批处理文件
- 备份与还原
- VMWare虚拟机设置固定ip上网方法
- 第三章 面向对象编程基础知识