03 2016 档案
摘要:微博开放平台:http://open.weibo.com/ 微博开放接口的调用,如发微博、关注等,都是需要获取用户身份认证的。目前微博开放平台用户身份鉴权主要采用的是OAuth2.0。另外,为了方便开发者开发、测试自己的应用,我们还提供了Basic Auth的身份鉴权方式,但Basic Auth仅适
阅读全文
posted @ 2016-03-22 16:52
浪味小仙女
摘要:分了三个任务下载每张图片,同时写入文件 viewController.m DownLoadManager.m DownLoadTask.m PictureCell.m
阅读全文
posted @ 2016-03-21 19:32
浪味小仙女
摘要:#import "ViewController.h" @interface ViewController ()<NSURLSessionDelegate,NSURLSessionTaskDelegate,NSURLSessionDataDelegate> @property (weak, nonat
阅读全文
posted @ 2016-03-21 11:22
浪味小仙女
摘要:简单下载图片 dispatch_queue_t queue =dispatch_queue_create(NULL, DISPATCH_QUEUE_CONCURRENT); dispatch_async(queue, ^{ //1.获取网址字符串 NSString * urlString = @"h
阅读全文
posted @ 2016-03-17 16:15
浪味小仙女
摘要:在子线程中是不能进行UI 更新的,而可以更新的结果只是一个幻像:因为子线程代码执行完毕了,又自动进入到了主线程,执行了子线程中的UI更新的函数栈,这中间的时间非常的短,就让大家误以为分线程可以更新UI。如果子线程一直在运行,则子线程中的UI更新的函数栈 主线程无法获知,即无法更新参考:http://
阅读全文
posted @ 2016-03-17 15:32
浪味小仙女
摘要:多线程 进程:内存里的一个程序就是一个进程,运行起来的程序就是一个进程,程序并不能单独运行,只有将程序装载到内存中,系统为它分配资源才能运行,每个进程均运行在其专用且受保护的内存空间内,而这种执行的程序就称之为进程。程序和进程的区别就在于:程序是指令的集合,它是进程运行的静态描述文本;进程是程序的一
阅读全文
posted @ 2016-03-16 14:45
浪味小仙女
摘要:1.创建数据库 NSString * docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject]; NSLog(@"%@",docPath); NSStri
阅读全文
posted @ 2016-03-14 11:20
浪味小仙女
摘要:创建表 create table if not exists Student (id integer primary key autoincrement,name varchar[20] not null,address varchar[100],image blob); 查看自己的创建语句 插入数
阅读全文
posted @ 2016-03-11 18:54
浪味小仙女
摘要:NSDate *date = [NSDate date]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"YYYYMMddhhmmss"]; NSString *form
阅读全文
posted @ 2016-03-10 10:43
浪味小仙女
摘要:UIAlertController * alert =[UIAlertController alertControllerWithTitle:@"新建相册" message:@"请输入新建相册的名字" preferredStyle:UIAlertControllerStyleAlert]; UIAl
阅读全文
posted @ 2016-03-09 14:53
浪味小仙女
摘要:NSUserDefault —— 保存少量数据 文件 —— 图片 视频 一个资源就是一个文件 数据库 —— SQLite3 C语言存储 CareData —— 可以以对象存储 应用程序的沙盒 1.获取应用程序允许用户操作的Document路径 NSString * docPath = [NSSear
阅读全文
posted @ 2016-03-08 22:00
浪味小仙女
摘要:NSFileCreationDate和NSFileModificationDate两个属性分别代表文件创建时间和修改时间 NSArray *sortedPaths = [array sortedArrayUsingComparator:^(NSString * firstPath, NSString
阅读全文
posted @ 2016-03-08 21:59
浪味小仙女
摘要://查看是否授权了。 if ([PHPhotoLibrary authorizationStatus] != PHAuthorizationStatusAuthorized){ NSLog(@"没有授权"); } //PHAsset 可以表示一个图片的信息 相册信息 //PHFetchResult
阅读全文
posted @ 2016-03-03 18:11
浪味小仙女
摘要:1.从系统相册中读取 /* 判断选择的读取类型是否支持 UIImagePickerControllerSourceTypePhotoLibrary,普通相册 UIImagePickerControllerSourceTypeCamera, 镜头(拍照、录视频) UIImagePickerContro
阅读全文
posted @ 2016-03-02 11:05
浪味小仙女
摘要:常常会用到对plist文件的封装,毕竟初学者,多记有经验 +(NSArray *)LoadFriendsDataFromPlist:(NSString *)pliatName{ NSString * filePath = [[NSBundle mainBundle]pathForResource:p
阅读全文
posted @ 2016-03-01 20:15
浪味小仙女
摘要:因为总是忘记所以记一下 1.scrollToRowAtIndexPath QQ会话中总是希望添加一行就向上滚动总是显示最新的消息 NSIndexPath *lastIndexPath = [NSIndexPath indexPathForRow:_messageArray.count-1 inSec
阅读全文
posted @ 2016-03-01 20:13
浪味小仙女
摘要:在仿写QQ会话的时候背景蓝色图片是拉伸而来,但是有些地方是受保护的不能拉伸 所以定义了下面的工具类中的一个方法,专门拉伸图片 UIImageResizingModeStretch:拉伸模式,通过拉伸UIEdgeInsets指定的矩形区域来填充图片 UIImageResizingModeTile:平铺
阅读全文
posted @ 2016-03-01 20:03
浪味小仙女
摘要:1.简单设置带属性的字符串 定义一个NSMutableAttributedString带属性的字符串 NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"hello[1_1] wor
阅读全文
posted @ 2016-03-01 19:53
浪味小仙女

浙公网安备 33010602011771号