随笔分类 -  iOS学习笔记系列

这是在学习iOS期间的一些笔记,作为对这一段时间的每日学习情况的记录,并方便以后复习
摘要:CALayer *layer = [CALayer layer]; [layer setBackgroundColor:[UIColor redColor].CGColor]; layer.bounds = CGRectMake(0, 0, 100, 100); layer.anchorPoint 阅读全文
posted @ 2016-03-03 16:57 small-elephant_A-Do 阅读(144) 评论(0) 推荐(0)
摘要:#import <AVFoundation/AVFoundation.h> @interface ViewController () @property(nonatomic,strong)AVAudioPlayer *player; @end @implementation ViewControll 阅读全文
posted @ 2016-02-29 20:11 small-elephant_A-Do 阅读(125) 评论(0) 推荐(0)
摘要:/** *创建一个队列(串行) **/ dispatch_queue_t queue1 = dispatch_queue_create("queue1", DISPATCH_QUEUE_SERIAL); /** *添加代码块 执行线程的路径 **/ dispatch_async(queue1, ^{ 阅读全文
posted @ 2016-02-29 10:21 small-elephant_A-Do 阅读(122) 评论(0) 推荐(0)
摘要:创建并调用本地通知的几个步骤 1,创建本地通知 2,设置处理时间 3,设置通知主体 4,可以设置传递的参数userinfo 5,调用通知 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(N 阅读全文
posted @ 2016-02-29 06:58 small-elephant_A-Do 阅读(175) 评论(0) 推荐(0)
摘要:首先创建layer CALayer *layer = [CALayer layer]; layer.bounds = CGRectMake(0, 0, 100, 100); layer.position = CGPointMake(100, 100); layer.backgroundColor = 阅读全文
posted @ 2016-02-27 13:20 small-elephant_A-Do 阅读(176) 评论(0) 推荐(0)
摘要:首先 添加图片到项目 UIImageView *imageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"1"]]; imageView.center = self.view.center; [self.view addS 阅读全文
posted @ 2016-02-27 09:23 small-elephant_A-Do 阅读(111) 评论(0) 推荐(0)
摘要:一,GCD简介 什么是GCD? 全程是Grand Central Dispatch,大中枢调度器 纯C语言,提供了很多强大的函数 GCD的优势 GCD是苹果公司为多核的并行运算提出的解决方案 GCD会自动利用更多的CPU内核(比如双核,四核) GCD会自动管理线程的生命周期(创建线程,调度任务,销毁 阅读全文
posted @ 2016-02-26 15:02 small-elephant_A-Do 阅读(126) 评论(0) 推荐(0)
摘要:JSON数据实例 首先找到路径 NSString *strUrl = @"http://localhost/Stu.json"; 得到request NSURL *url = [NSURL URLWithString:strUrl]; NSURLRequest *request = [NSURLRe 阅读全文
posted @ 2016-02-26 14:20 small-elephant_A-Do 阅读(151) 评论(0) 推荐(0)
摘要:用到NSKeyedArchive要用这个方法做初始化,软件中永远绕不开的一个问题就是数据存储的问题,PC的时候一般都是选择在数据库中存储,iOS如果是和后端配合的话,那么不需要考虑数据存储的这个问题,上次写了一下plist的存储,不过数据都是存储一些简单的键值对对象。本次需要将一些自己定义的类型存储 阅读全文
posted @ 2016-02-26 11:14 small-elephant_A-Do 阅读(187) 评论(0) 推荐(0)
摘要:XML示例 <students> <student> <name>kellen</name> <pass>111111</pass> </student> <student> <name>wch</name> <pass>222222</pass> </student> </students> 有开 阅读全文
posted @ 2016-02-26 10:44 small-elephant_A-Do 阅读(182) 评论(0) 推荐(0)
摘要:POST方法要设置HTTPmethod HTTPbody 同步请求代码核心代码:43 NSData *data=[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; 异步请求 NSOpera 阅读全文
posted @ 2016-02-26 00:00 small-elephant_A-Do 阅读(147) 评论(0) 推荐(0)
摘要:首先 介绍一下HTTP协议 URL的全称是Uniform Resource Locator(统一资源定位符) URL中常见的协议有 HTTP超文本传输协议,访问的是远程的网络资源 FILE 访问的是本地计算机的资源 MAILTO 访问的是电子邮件地址 FTP 访问的是共享主机的文件资源 HTTP协议 阅读全文
posted @ 2016-02-25 23:55 small-elephant_A-Do 阅读(202) 评论(0) 推荐(0)
摘要:socket编程: TCP UDP 线程实现多客户端通信 阅读全文
posted @ 2016-02-25 11:21 small-elephant_A-Do 阅读(129) 评论(0) 推荐(0)
摘要:找资料找了很久,网上都是一些水货,最后终于学会,下面来介绍一下。 以前只有iPad有这种视图形式,现在用 UIModalPresentationController可以实现iPad和iphone 如图,现在SB中设置两个视图,然后建立联系(push as popover) 设置segwe的ident 阅读全文
posted @ 2016-02-25 00:05 small-elephant_A-Do 阅读(230) 评论(0) 推荐(0)
摘要:首先上预览图 主要的实现逻辑在这里 阅读全文
posted @ 2016-02-24 22:53 small-elephant_A-Do 阅读(196) 评论(0) 推荐(0)
摘要:今天写qq的模仿项目,找到一个比较简单的第三方框架 MMDrawerController 下面简单介绍一下 MMDrawerController的使用 预览效果如图 创建一个抽屉视图 UIViewController * leftDrawer = [[UIViewController alloc] 阅读全文
posted @ 2016-02-24 22:43 small-elephant_A-Do 阅读(2355) 评论(0) 推荐(0)
摘要:predicate语句 补充 /** *1,以xx开头:@"stuname beginswith%@",@"x" 2,以xx结尾,@"stuname endswith%@",@".com" 3,基本用法:类中的属性名 =,>,<,...,contains @"stuname contains%@", 阅读全文
posted @ 2016-02-24 15:18 small-elephant_A-Do 阅读(128) 评论(0) 推荐(0)
摘要:先引入 建立一个数据库 NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject]; NSLog(@"%@",path); NSString 阅读全文
posted @ 2016-02-24 10:38 small-elephant_A-Do 阅读(170) 评论(0) 推荐(0)
摘要:/** * 应用数据库步骤: 1,sqlite3_open:打开或者创建数据库并做连接操作 2,用sql语句,创建数据库 3,无返回值时,用exec语句操作执行数据库语句 4,有返回值时,用prepare语句查询函数,结果集遍历得到结果,遍历语句sqlite_step(stmt) == SQLITE 阅读全文
posted @ 2016-02-23 11:06 small-elephant_A-Do 阅读(133) 评论(0) 推荐(0)
摘要:1,创建数据库:sqlite3 数据库名.db 2,显示数据库: .database 3,创建表:create table 表名(字段名1 字段类型,字段名2 字段类型,...); 4,插入数据:insert into 表名(字段1,字段2..) values(字段1的值,字段2的值...); 5, 阅读全文
posted @ 2016-02-22 15:54 small-elephant_A-Do 阅读(185) 评论(0) 推荐(0)