文章分类 -  OC UICocoaTouch

摘要:时间 2014-02-17 14:32:00 博客园-所有随笔区 原文 http://www.cnblogs.com/xuym1992/p/3552555.html 时间 2014-02-17 14:32:00 博客园-所有随笔区 原文 http://www.cnblogs.com/xuym1992 阅读全文
posted @ 2016-04-05 16:50 lance.xiang 阅读(184) 评论(0) 推荐(0)
摘要:在使用UIKit的过程中,性能优化是永恒的话题。很多人都看过分析优化滑动性能的文章,但其中不少文章只介绍了优化方法却对背后的原理避而不谈,或者是晦涩难懂而且读者缺乏实践体验的机会。不妨思考一下下面的问题自己是否有一个清晰的认识: 本文会结合Instrument分析影响性能的因素,提出优化方案并解释背 阅读全文
posted @ 2016-04-05 16:40 lance.xiang 阅读(117) 评论(0) 推荐(0)
摘要:原文出处: 南峰子的技术博客 Objective-C中的分类允许我们通过给一个类添加方法来扩充它(但是通过category不能添加新的实例变量),并且我们不需要访问类中的代码就可以做到。 Objective-C中的协议是普遍存在的接口定义方式,即在一个类中通过@protocol定义接口,在另外类中实 阅读全文
posted @ 2016-03-31 13:35 lance.xiang 阅读(119) 评论(0) 推荐(0)
摘要:原文出处: 南峰子的技术博客 前面我们讨论了Runtime中对类和对象的处理,及对成员变量与属性的处理。这一章,我们就要开始讨论Runtime中最有意思的一部分:消息处理机制。我们将详细讨论消息的发送及消息的转发。不过在讨论消息之前,我们先来了解一下与方法相关的一些内容。 基础数据类型 SEL SE 阅读全文
posted @ 2016-03-31 13:32 lance.xiang 阅读(139) 评论(0) 推荐(0)
摘要:原文出处: 南峰子的技术博客 原文出处: 南峰子的技术博客 在前面一篇文章中,我们介绍了Runtime中与类和对象相关的内容,从这章开始,我们将讨论类实现细节相关的内容,主要包括类中成员变量,属性,方法,协议与分类的实现。 本章的主要内容将聚集在Runtime对成员变量与属性的处理。在讨论之前,我们 阅读全文
posted @ 2016-03-31 13:27 lance.xiang 阅读(98) 评论(0) 推荐(0)
摘要:原文出处: 南峰子的技术博客 原文出处: 南峰子的技术博客 Objective-C语言是一门动态语言,它将很多静态语言在编译和链接时期做的事放到了运行时来处理。这种动态语言的优势在于:我们写代码时更具灵活性,如我们可以把消息转发给我们想要的对象,或者随意交换一个方法的实现等。 这种特性意味着Obje 阅读全文
posted @ 2016-03-31 13:25 lance.xiang 阅读(122) 评论(0) 推荐(0)
摘要:01. CLLocation CLLocationManager 定位管理者 CLLocation 代表位置(经度/纬度/高度/速度/路线等) CLHeading 代表移动方向 CLRegion 代表一个区域 >CLCircularRegion 圆形区域 >CLBeaconRegion 蓝牙信号区域 阅读全文
posted @ 2016-03-31 12:00 lance.xiang 阅读(144) 评论(0) 推荐(0)
摘要:#import "ViewController.h" #import "FMDatabase.h" @interface ViewController () @end @implementation ViewController // tap each button in turn, watch c 阅读全文
posted @ 2016-03-30 20:59 lance.xiang 阅读(72) 评论(0) 推荐(0)
摘要:1.HTTP:基本概念 应用场景 常见的数据请求方式区别 短链接 2.HTTP Socket(一组封装了TCP IP协议的接口 长链接) TCP(面向链接 可靠 较低) UDP(非链接 不可靠 较高)四个概念区分 3.TCP三次握手 (A->B A发起B的链接请求数据包 B->A 同意链接请求同步数 阅读全文
posted @ 2016-03-30 20:15 lance.xiang 阅读(141) 评论(0) 推荐(0)
摘要:#import "ViewController.h" @interface ViewController () <UISearchBarDelegate> @property (weak, nonatomic) IBOutlet UIWebView *webView; @property (weak 阅读全文
posted @ 2016-03-29 22:11 lance.xiang 阅读(110) 评论(0) 推荐(0)
摘要:#import "MViewController.h" /** 需求分析 1. UIImageView显示图片 2. UIImage模拟从网络上下载 3. NSString记录图片路径 小结 方法,看起来很简单, 1> 不能够自动回收线程,如果并发数量多,会建立大量的子线程! 2> 使用NSThre 阅读全文
posted @ 2016-03-29 22:00 lance.xiang 阅读(106) 评论(0) 推荐(0)
摘要:#import <Foundation/Foundation.h> @interface DemoObj : NSObject // 共享实例,便于其他类访问 + (instancetype)sharedDemoObj; @end #import "DemoObj.h" @implementatio 阅读全文
posted @ 2016-03-29 21:57 lance.xiang 阅读(90) 评论(0) 推荐(0)
摘要:#import <Foundation/Foundation.h> @interface DemoObj : NSObject - (void)demoBlockOp; @end #import "DemoObj.h" @interface DemoObj() @property (nonatomi 阅读全文
posted @ 2016-03-29 21:51 lance.xiang 阅读(99) 评论(0) 推荐(0)
摘要:#import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"%@", [N 阅读全文
posted @ 2016-03-29 21:48 lance.xiang 阅读(141) 评论(0) 推荐(0)
摘要:// #import "ViewController.h" @interface ViewController () @end @implementation ViewController /* >1 队列和线程的区别: 队列:是管理线程的,相当于线程池,能管理线程什么时候执行。 队列分为串行队列和 阅读全文
posted @ 2016-03-29 21:39 lance.xiang 阅读(218) 评论(0) 推荐(0)
摘要:#import "MXCircleView.h" @implementation MXCircleView - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initializ 阅读全文
posted @ 2016-03-29 21:25 lance.xiang 阅读(133) 评论(0) 推荐(0)
摘要:@interface UIView : UIResponder<NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem> /** * 通过一个frame来初始化一个UI控件 */ - (id)initWithFrame:(CGRect 阅读全文
posted @ 2016-03-29 20:55 lance.xiang 阅读(91) 评论(0) 推荐(0)
摘要:#import "MXAppDelegate.h" @implementation MXAppDelegate /** * app启动完毕后就会调用 */ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithO 阅读全文
posted @ 2016-03-29 20:49 lance.xiang 阅读(126) 评论(0) 推荐(0)
摘要:#import <Foundation/Foundation.h> #import "Person.h" #import "NewsCompany.h" int main(int argc, const char * argv[]) { @autoreleasepool { // 1.初始化机构 N 阅读全文
posted @ 2016-03-29 20:39 lance.xiang 阅读(105) 评论(0) 推荐(0)
摘要:#import "MXViewController.h" @interface MJViewController () <UIScrollViewDelegate> @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; @pro 阅读全文
posted @ 2016-03-29 20:33 lance.xiang 阅读(89) 评论(0) 推荐(0)