摘要: 代码如下,在UITableViewDataSource中设置- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{NSMutableArray *arr = [[[NSMutableArray alloc] initWithCapacity:0] autorelease];[arr addObject:@"{search}"];//等价于[arr addObject:UITableViewIndexSearch];return arr;}效果图:...http://www.cocoachin 阅读全文
posted @ 2011-11-01 21:49 痴人指路 阅读(141) 评论(0) 推荐(0) 编辑
摘要: //检查数据库|| 复制数据库文件 NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *folderPath = [searchPaths objectAtIndex:0]; NSString *dbfilePath = [folderPath stringByAppendingPathComponent:DB_FILE_NAME]; if (![[NSFileManager defaultMan... 阅读全文
posted @ 2011-11-01 17:38 痴人指路 阅读(197) 评论(0) 推荐(0) 编辑
摘要: //写入:NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);NSString *dataPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@”sqlite.sqlite”];NSData *image=UIImagePNGRepresentation([UIImage imageNamed:@"01_02.png"]);NSString *aaa=[[NSS 阅读全文
posted @ 2011-11-01 17:07 痴人指路 阅读(409) 评论(0) 推荐(0) 编辑
摘要: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);//多页面操作mydata.plist if (![[NSFileManager defaultManager] fileExistsAtPath:[[paths objectAtIndex:0] stringByAppendingPathComponent:@"mydata.plist"]]) { if ([[NSFileManager defaultManager] copyIt 阅读全文
posted @ 2011-11-01 09:30 痴人指路 阅读(174) 评论(0) 推荐(0) 编辑