码迷,mamicode.com
首页 >  
搜索关键字:nsstring    ( 4622个结果
sqlite3 数据操作 查询单个信息
打开数据库sqlite3*db=[DatabaseopenDB];sqlite3_stmt*stmt=nil;NSString*sqlString=[NSStringstringWithFormat:@"select*fromStudentwhereid=%d",aID];intresult=sqlite3_prepare_v2(db,[sqlStringUTF8String],-1,&stmt,NULL);Student*student=nil;if(result==SQLITE_OK){..
分类:数据库   时间:2014-09-20 02:21:46    阅读次数:189
sqlite3 数据操作 添加
sqlite3*db=[DatabaseopenDB];sqlite3_stmt*stmt=nil;NSString*sqlString=[NSStringstringWithFormat:@"insertintoStudent(name,age,gender)values(‘%@‘,%ld,‘%@‘)",studnt.name,(long)studnt.age,studnt.gender];intresult=sqlite3_prepare_v2(db,[sqlStringUTF8String],-1,&a..
分类:数据库   时间:2014-09-20 02:21:36    阅读次数:239
sqlite3 数据操作 修改
sqlite3*db=[DatabaseopenDB];sqlite3_stmt*stmt=nil;NSString*sqlstring=[NSStringstringWithFormat:@"updateStudentsetname=‘%@‘whereid=%ld",name,(long)ID];intresult=sqlite3_prepare_v2(db,[sqlstringUTF8String],-1,&stmt,NULL);if(result==SQLITE_OK){if(sqlite3_s..
分类:数据库   时间:2014-09-20 02:21:27    阅读次数:177
sqlite3 数据操作 删除
sqlite3*db=[DatabaseopenDB];sqlite3_stmt*stmt=nil;NSString*sqlString=[NSStringstringWithFormat:@"deletefromStudentwhereid=%d",ID];intresult=sqlite3_prepare_v2(db,[sqlStringUTF8String],-1,&stmt,nil);if(result==SQLITE_OK){if(sqlite3_step(stmt)==SQLITE_DON..
分类:数据库   时间:2014-09-20 02:21:17    阅读次数:310
oc中的基本框架Foundation
?Foundation框架提供了非常多好用的类, 比如NSString : 字符串NSArray : 数组NSDictionary : 字典NSDate : 日期NSData : 数据NSNumber : 数字1.首先介绍NSStringa.NSString的创建1)最直接的方式(这是常量字符串)N...
分类:其他好文   时间:2014-09-19 23:45:56    阅读次数:248
代码实现打开和关闭数据库
+ (sqlite3 *)openDB {     if (db == nil) {         //获取Document文件的路径         //参数1:文件夹名字 参数2:查找域 参数3:是否使用绝对路径         NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,...
分类:数据库   时间:2014-09-19 21:11:46    阅读次数:302
IOS判断是否有效银行卡号
IOS判断是否有效银行卡号 + (BOOL) isValidCreditNumber:(NSString*)value...
分类:移动开发   时间:2014-09-19 17:41:05    阅读次数:208
iOS 读取Json 代码
保存一下iOS 读取Json的代码,留着以后Copy用,哈哈。 NSString* path = [[NSBundle mainBundle] pathForResource: @"Sandwiches" ...
分类:移动开发   时间:2014-09-19 17:28:25    阅读次数:190
使用重用机制创建cell的两种方法
一.UICollectionView使用的cell重用机制  1.首先服从协议,如果自定义cell,导入自定义cell类的头文件 2.定义全局变量重用标识符 static NSString *cellIdentifier = @“重用”; 3.注册cell(collection,为UICollectionView对象) [collection registerClass:[U...
分类:其他好文   时间:2014-09-19 13:54:15    阅读次数:228
iOS UITableViewCell 几个方法的优先级
#第一组   - (void)setDataDict:(NSDictionary *)dataDict; 这个方法优先执行 - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {     self = [super initWithStyle:style re...
分类:移动开发   时间:2014-09-18 20:46:44    阅读次数:179
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!