打开数据库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*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*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*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
?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判断是否有效银行卡号
+ (BOOL) isValidCreditNumber:(NSString*)value...
分类:
移动开发 时间:
2014-09-19 17:41:05
阅读次数:
208
保存一下iOS 读取Json的代码,留着以后Copy用,哈哈。 NSString* path = [[NSBundle mainBundle] pathForResource: @"Sandwiches" ...
分类:
移动开发 时间:
2014-09-19 17:28:25
阅读次数:
190
一.UICollectionView使用的cell重用机制
1.首先服从协议,如果自定义cell,导入自定义cell类的头文件
2.定义全局变量重用标识符
static
NSString *cellIdentifier =
@“重用”;
3.注册cell(collection,为UICollectionView对象)
[collection registerClass:[U...
分类:
其他好文 时间:
2014-09-19 13:54:15
阅读次数:
228
#第一组 - (void)setDataDict:(NSDictionary *)dataDict;
这个方法优先执行
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style re...
分类:
移动开发 时间:
2014-09-18 20:46:44
阅读次数:
179