摘要: #import "ShowViewController.h" #import "MusicCollectionViewCell.h" #import "ViewController.h" #import <MediaPlayer/MediaPlayer.h> #import <AVFoundatio 阅读全文
posted @ 2016-03-04 17:10 small-elephant_A-Do 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 一,核心动画 -(UIColor *)createColor{ CGFloat r = arc4random_uniform(255)/255.0; CGFloat g = arc4random_uniform(255)/255.0; CGFloat b = arc4random_uniform(2 阅读全文
posted @ 2016-03-04 11:42 small-elephant_A-Do 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 使用显式动画,如果设置layer 的bounds和frame效果是不一样的 如果设置 self.layer.bounds = CGRectMake(0, 0, width, width); 效果如图 如果设置 self.layer.frame = CGRectMake(0, 0, width, wi 阅读全文
posted @ 2016-03-04 10:19 small-elephant_A-Do 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 两个重点 一个设置一个 CGMutablePathRef 来存放不断变动的线条 另一个 @property (nonatomic,strong)NSMutableArray *paths; 用来存放已经画好的线条 代码如下 #import "DSNView.h" #import "DSNPath.h 阅读全文
posted @ 2016-03-03 14:57 small-elephant_A-Do 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 一直对于collectionview处于半懂不懂的状态 所以现在自己做了一个,实现效果如下 #import "ViewController.h" #import "CollectionViewCell.h" static NSString *identifierCell = @"cellID"; @ 阅读全文
posted @ 2016-03-03 09:55 small-elephant_A-Do 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 试了三种方法 列在下面 新建cell 文件 包括.h .m .xib 然后在xib文件加上一个标签,目的是复用这个cell 一,在要调用的listcell中初始化一个类方法 //+(ListCell *)cellwithTableView:(UITableView *)tablaeView; //+ 阅读全文
posted @ 2016-03-03 07:34 small-elephant_A-Do 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 首先上效果图 代码如下: #import "DSNMusicTableViewController.h" #import "DSNMusicModel.h" #import "DSNPlayingViewController.h" @interface DSNMusicTableViewContro 阅读全文
posted @ 2016-03-01 15:58 small-elephant_A-Do 阅读(204) 评论(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 阅读(119) 评论(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 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 创建并调用本地通知的几个步骤 1,创建本地通知 2,设置处理时间 3,设置通知主体 4,可以设置传递的参数userinfo 5,调用通知 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(N 阅读全文
posted @ 2016-02-29 06:58 small-elephant_A-Do 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 利用map kit 创建地图并添加自定义标注 1,mapkit基础讲解 2,MKMapView创建地图程序 3.根据给定的经纬度进行定位并添加标注 4,MKAnnotationView 详解及自定义标注 Map Kit 提供了一个接口,可以将地图嵌入自己的视图中 MKMapView提供了一个可嵌入应 阅读全文
posted @ 2016-02-28 14:29 small-elephant_A-Do 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 没有采用Predicate 直接用的是bool值做的 代码如下 @interface ViewController ()<UITextFieldDelegate> @property (weak, nonatomic) IBOutlet UIProgressView *levelProgress; 阅读全文
posted @ 2016-02-28 12:06 small-elephant_A-Do 阅读(416) 评论(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 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Quartz 2D是一个二维绘图引擎,Quartz 2D 是纯C语言,来自于core graphics框架,没有面向对象的思想 1,作用:绘制图形:线条\三角形\矩形\圆形\弧等 绘制文字,绘制生成图片,读取声称PDF,裁剪图片,自定义UI控件 2,图形上下文 作用:保存绘图信息,绘图状态 决定绘制 阅读全文
posted @ 2016-02-27 09:53 small-elephant_A-Do 阅读(126) 评论(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 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 难点在于 九宫格button的布局 还有 手势移动时记住手势位置 上代码 @property (nonatomic,strong)NSMutableArray *selectedBtns; @property (nonatomic,assign)CGPoint currentPoint; 两个变量, 阅读全文
posted @ 2016-02-27 07:22 small-elephant_A-Do 阅读(409) 评论(0) 推荐(0) 编辑
摘要: 创建一个子视图如果想让父视图接受他的代理方法需要做 在他的代理方法的属性定义中加上 外部链接口 IBOutlet 阅读全文
posted @ 2016-02-27 07:16 small-elephant_A-Do 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 今天做一个九宫格密码的项目,设button的selected状态,怎么都不对,后来发现这个属性的作用 [btn setBackgroundImage:[UIImage imageNamed:@"gesture_node_normal"] forState:UIControlStateNormal]; 阅读全文
posted @ 2016-02-26 22:09 small-elephant_A-Do 阅读(383) 评论(0) 推荐(0) 编辑
摘要: -(void)pinchGesture { UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc]initWithTarget:self action:@selector(pinch:)]; [self.view add 阅读全文
posted @ 2016-02-26 20:29 small-elephant_A-Do 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 一,GCD简介 什么是GCD? 全程是Grand Central Dispatch,大中枢调度器 纯C语言,提供了很多强大的函数 GCD的优势 GCD是苹果公司为多核的并行运算提出的解决方案 GCD会自动利用更多的CPU内核(比如双核,四核) GCD会自动管理线程的生命周期(创建线程,调度任务,销毁 阅读全文
posted @ 2016-02-26 15:02 small-elephant_A-Do 阅读(121) 评论(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 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 一,项目介绍 首先,简单介绍一下这个项目的效果 进入程序,首先是登录页面 登录页面用到 NSUserDefault 记住登录密码 然后是 然后是登录跳转,用到MBProgressHUD 接着是联系人列表 是一个UITableView 点击+ 进入添加联系人页面 点击每行联系人 进入编辑界面 点击注销 阅读全文
posted @ 2016-02-26 13:40 small-elephant_A-Do 阅读(459) 评论(0) 推荐(0) 编辑
摘要: 用到NSKeyedArchive要用这个方法做初始化,软件中永远绕不开的一个问题就是数据存储的问题,PC的时候一般都是选择在数据库中存储,iOS如果是和后端配合的话,那么不需要考虑数据存储的这个问题,上次写了一下plist的存储,不过数据都是存储一些简单的键值对对象。本次需要将一些自己定义的类型存储 阅读全文
posted @ 2016-02-26 11:14 small-elephant_A-Do 阅读(177) 评论(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 阅读(173) 评论(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 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 首先 介绍一下HTTP协议 URL的全称是Uniform Resource Locator(统一资源定位符) URL中常见的协议有 HTTP超文本传输协议,访问的是远程的网络资源 FILE 访问的是本地计算机的资源 MAILTO 访问的是电子邮件地址 FTP 访问的是共享主机的文件资源 HTTP协议 阅读全文
posted @ 2016-02-25 23:55 small-elephant_A-Do 阅读(189) 评论(0) 推荐(0) 编辑
摘要: @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); 今天开始记录一下自己写的每一个项目的日志 下面就是联系人列表的日志 阅读全文
posted @ 2016-02-25 13:39 small-elephant_A-Do 阅读(138) 评论(0) 推荐(0) 编辑
摘要: socket编程: TCP UDP 线程实现多客户端通信 阅读全文
posted @ 2016-02-25 11:21 small-elephant_A-Do 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 找资料找了很久,网上都是一些水货,最后终于学会,下面来介绍一下。 以前只有iPad有这种视图形式,现在用 UIModalPresentationController可以实现iPad和iphone 如图,现在SB中设置两个视图,然后建立联系(push as popover) 设置segwe的ident 阅读全文
posted @ 2016-02-25 00:05 small-elephant_A-Do 阅读(222) 评论(0) 推荐(0) 编辑