当前位置: 首页 > news >正文

有没有专门做数据分析的网站我有虚拟服务器怎么快速做网站

有没有专门做数据分析的网站,我有虚拟服务器怎么快速做网站,网页设计与网站建设的目的,建筑工程有限责任公司这周基本完成了知乎日报的内容#xff0c;主要写了点赞收藏的滑动刷新的保存#xff0c;还有收藏文章的功能#xff0c;主要用到FMDB库。 对于如何使用FMDB库 同样需要用cocopads引入FMDB库,使用时需要引入头文件 #import FMDatabase.hFMDB库的使用类似于C语…这周基本完成了知乎日报的内容主要写了点赞收藏的滑动刷新的保存还有收藏文章的功能主要用到FMDB库。 对于如何使用FMDB库 同样需要用cocopads引入FMDB库,使用时需要引入头文件 #import FMDatabase.hFMDB库的使用类似于C语言的文件操作需要我们手动创库之后编译器会生成一个文件用于数据的存储当程序关闭后文件中的内容也不会消失当程序重新启动后会继续利用从而达到本地持久化。 FMDB的创建 - (void)dateBaseInit {NSString* collectionDoc [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];NSString* filename [collectionDoc stringByAppendingPathComponent:collection1.sqlite];self.collectionDataBase [FMDatabase databaseWithPath:filename];if ([self.collectionDataBase open]) {BOOL result [self.collectionDataBase executeUpdate:CREATE TABLE IF NOT EXISTS collectionData (mainLabel text NOT NULL, imageURL text NOT NULL, id text NOT NULL, url text NOT NULL);];if (result) {NSLog(创表成功);} else {NSLog(创表失败);}}NSString *goodDoc [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];NSString * fileName [goodDoc stringByAppendingPathComponent:likes.sqlite];self.likesDataBase [FMDatabase databaseWithPath:fileName];if ([self.likesDataBase open]) {BOOL result [self.likesDataBase executeUpdate:CREATE TABLE IF NOT EXISTS likesData (id text NOT NULL);];if (result) {NSLog(创表成功);} else {NSLog(创表失败);}} }不必在意其何时创建的只要在你用到它时创建好就行。在程序重新启动时该段代码会在执行一遍但不会创建一个新的库覆盖前面的可以理解为会执行但没有任何效果。 数据的添加删除查询。 - (void)insertLikesData:(NSString*)string {if ([self.likesDataBase open]) {BOOL result [self.likesDataBase executeUpdate:INSERT INTO likesData (id) VALUES (?);, string];if (!result) {NSLog(增加数据失败);} else {NSLog(增加数据成功);}[self.likesDataBase close];} }- (void)deleteLikesDate:(NSString*)nowID {if ([self.likesDataBase open]) {NSString *sql delete from likesData WHERE id ?;BOOL result [self.likesDataBase executeUpdate:sql, nowID];if (!result) {NSLog(数据删除失败);} else {NSLog(数据删除成功);}[self.likesDataBase close];} }NSString* collectionDoc [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];NSString* filename [collectionDoc stringByAppendingPathComponent:collection1.sqlite];self.collectionDataBase [FMDatabase databaseWithPath:filename];if ([self.collectionDataBase open]) {FMResultSet* collectionResultSet [self.collectionDataBase executeQuery:SELECT * FROM collectionData];while ([collectionResultSet next]) {NSString* idString [collectionResultSet stringForColumn:id];if ([nowIdSting isEqualToString:idString]) {self.flage1 1;self.keepButton.tag 6;[self.keepButton setImage:[UIImage imageNamed:shoucangxuanzhong-2] forState:UIControlStateNormal];}}[self.collectionDataBase close];}对于在不同的文件下获取到库在开始没有理解其用处以为要将库保存下来并传值那么就没有必要创这个库。以上面的查询为例获取数据库文件的路径获取数据库注意文件的路径必须一样。 NSString* collectionDoc [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];NSString* filename [collectionDoc stringByAppendingPathComponent:collection1.sqlite];self.collectionDataBase [FMDatabase databaseWithPath:filename];对于点赞收藏的滑动刷新 获取该文章的ID遍历数据库判断是否收藏点赞同时刷新控件这里要注意要改变按钮的点击状态这里是改变按钮的tag值 - (void)likesAndCollectReload:(NSString*) nowIdSting{self.flage1 0;self.flage2 0;NSString* collectionDoc [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];NSString* filename [collectionDoc stringByAppendingPathComponent:collection1.sqlite];self.collectionDataBase [FMDatabase databaseWithPath:filename];if ([self.collectionDataBase open]) {FMResultSet* collectionResultSet [self.collectionDataBase executeQuery:SELECT * FROM collectionData];while ([collectionResultSet next]) {NSString* idString [collectionResultSet stringForColumn:id];if ([nowIdSting isEqualToString:idString]) {self.flage1 1;self.keepButton.tag 6;[self.keepButton setImage:[UIImage imageNamed:shoucangxuanzhong-2] forState:UIControlStateNormal];}}[self.collectionDataBase close];}if (self.flage1 0) {self.keepButton.tag 3;[self.keepButton setImage:[UIImage imageNamed:shoucang-2] forState:UIControlStateNormal];}NSString *goodDoc [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];NSString * fileName [goodDoc stringByAppendingPathComponent:likes.sqlite];self.likesDataBase [FMDatabase databaseWithPath:fileName];if ([self.likesDataBase open]) {// 1.执行查询语句FMResultSet *likesResultSet [self.likesDataBase executeQuery:SELECT * FROM likesData];// 2.遍历结果while ([likesResultSet next]) {NSString* idString1 [likesResultSet stringForColumn:id];if ([nowIdSting isEqualToString:idString1]) {self.flage2 1;self.likesButton.tag 4;[self.likesButton setImage:[UIImage imageNamed:a-24geshangchuan-20] forState:UIControlStateNormal];}}[self.likesDataBase close];}if (self.flage2 0) {self.likesButton.tag 2;[self.likesButton setImage:[UIImage imageNamed:good] forState:UIControlStateNormal];} }对于文章的收藏于取消收藏我们一般将数据库的数据提取到数组中使用在数据库内容发生改变时就需要重新提取。以在文章内容界面取消收藏返回收藏夹更新收藏夹的内容为例子。这里用到通知在返回到收藏夹执行相应的更新方法 [[NSNotificationCenter defaultCenter] postNotificationName:reloadCollectCell object:nil userInfo:nil];[self dismissViewControllerAnimated:YES completion:nil];- (void)reloadCollectCell{[self twoArrayInit];[self.storiesTableView reloadData]; } - (void)twoArrayInit {self.titleArray [NSMutableArray array];self.imageUrlArray [NSMutableArray array];self.idArray [NSMutableArray array];self.urlArray [NSMutableArray array];NSString* collectionDoc [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];NSString* filename [collectionDoc stringByAppendingPathComponent:collection1.sqlite];self.collectionDataBase [FMDatabase databaseWithPath:filename];if ([self.collectionDataBase open]) {FMResultSet* collectionResultSet [self.collectionDataBase executeQuery:SELECT * FROM collectionData];while ([collectionResultSet next]) {NSString* idString [collectionResultSet stringForColumn:id];[self.idArray addObject:idString];[self.titleArray addObject:[collectionResultSet stringForColumn:mainLabel]];[self.imageUrlArray addObject:[collectionResultSet stringForColumn:imageURL]];[self.urlArray addObject:[collectionResultSet stringForColumn:url]];}[self.collectionDataBase close];} }
http://www.pierceye.com/news/173598/

相关文章:

  • 网站开发设计合同北京网站排名优化公司
  • 免费建立个人网站凡科怎么下载app
  • 网站题头是什么做线上网站需要钱吗
  • 陕西省建设工程监理协会网站 查询动易网站首页错位
  • 老公做网站网站推广wordpress 文件加载顺序
  • 网站开发保存学习进度的方案搭建网站免费
  • 做网站对外贸有什么用网站怎么防k
  • 网站开发网站建设常州建站程序
  • 赤峰建设局网站物流公司网站制作模板
  • 装修第三方平台网站建设网站开发及设计
  • 男女做那个的小视频网站个人如何注册公司流程
  • 机关网站建设前期准备工作wordpress替代
  • 机关网站建设无锡宜兴网站建设
  • 江苏景禾瑜博建设工程有限公司网站做网站注册公司
  • 如何找到做网站的客户贵州二建报名入口官网
  • 网站怎么做301定向wordpress极客式主题
  • 造价工程建设协会网站怎么把做的网站发布
  • 万网网站首页好企业网站
  • 廊坊做网站电话企业网络搭建拓扑图
  • 建设社区网站有什么借鉴之处专业网站制作哪家专业
  • 南宁网站推广流程wordpress 雅黑字体
  • 个人网站制作代码河北seo基础知识
  • 国内做视频的网站有哪些企业网站价格花
  • 泰安网站推广优化wordpress首页图片
  • 政协网站建设更改wordpress管理员用户名
  • 网站浏览器兼容性通用有那种网站么
  • 网站中全景是怎么做的云南网络营销文化优化
  • 苏州网站优化哪家好换空间对网站的影响
  • 如何做黑客攻击网站专业的网站建设运营
  • 门户网站建站流程做网站在哪里做比较好