摘要: 库是共享程序代码的方式,一般分为静态库和动态库静态库:链接时完整地拷贝至可执行文件中,被多次使用就有多份冗余拷贝。动态库:链接时不复制,程序运行时由系统动态加载到内存,供程序调用,系统只加载一次,多个程序共用,节省内存。iOS里静态库形式:.a和.framework下面就一步一步制作一个.a静态库第一步,新建工程> 选择iOS\Framework & Library\Cocoa Touch Static Library> 点击next输入项目名称(这里举例子用MFKit)> 点击next,点击create创建工程第二步, 添加需要的类或方法> 添加需要的方法(这 阅读全文
posted @ 2014-01-12 17:11 yuan555 阅读(251) 评论(0) 推荐(0) 编辑
摘要: // cmd + n 新建Header File 文件名: Singleton.h// .h#define singleton_interface(className) + (instancetype)shared##className;// .m// 注意:最后一句不要斜线#define singleton_implementation(className) \static className *_instace; \\+ (id)allocWithZone:(struct _NSZone *)zone \{ \ static dispatch_once_t onceToken; \ ... 阅读全文
posted @ 2014-01-09 14:50 yuan555 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 1 #pragma mark - 谓词基本使用 2 - (void)demo1 3 { 4 // 谓词的用处是用来判断对象是否符合某种要求 5 // predicateWithFormat指定谓词匹配的条件 6 NSPredicate *predicate = [NSPredicate predicateWithFormat:@"self CONTAINS 'ao'"]; 7 8 NSString *str = @"hello"; 9 10 // 用谓词来匹配字符串11 if ([predicate evaluateWithO... 阅读全文
posted @ 2014-01-09 14:41 yuan555 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Analyze是一个编译和分析工具,可以发现编译中的warning,内存泄露隐患,有时还可以查处逻辑上的问题。内存泄露隐患提示:Potential Leak of an object allocated on line ……数据赋值隐患提示:The left operand of …… is a garbage value;对象引用隐患提示:Reference-Counted object is used after it is released;Analyze发现的问题值得我们注意,但它只是提出隐患,并不一定就存在问题。Analyze运行方法:Product->Analyze,或 阅读全文
posted @ 2014-01-06 17:34 yuan555 阅读(409) 评论(0) 推荐(0) 编辑
摘要: 转自博文:http://www.cnblogs.com/liufan9/p/3491672.html 阅读全文
posted @ 2014-01-02 22:01 yuan555 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 一、好处One of the big advantages of using @import is that you don't need to add the framework in the project settings, it's done automatically. That means that you can skip the step where you click the plus button and search for the framework (golden toolbox), then move it to the "Framewor 阅读全文
posted @ 2014-01-02 16:04 yuan555 阅读(1684) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 一. 手势说明 3 4 0> UIGestureRecognizer 所有手势识别的父类,不允许直接使用 5 6 最常用的属性: 7 view: 发生手势的视图 8 state: 手势当前的状态,主要用于连续手势,对于离散手势一般不使用 9 10 1> UITapGestureRecognizer 点按手势(离散手势,其他手势都是连续手势) 11 12 属性: 13 numberOfTapsRequired 点击次数,单击双击 14 number... 阅读全文
posted @ 2014-01-02 14:08 yuan555 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 1.常用方法1)创建导航控制器[[UINavigationController alloc] initWithRootViewController:self.viewController];2)压栈,将控制器压入栈中[self.navigationController pushViewController:second animated:YES];3)出栈,从栈中弹出控制器1> 弹出当前栈顶控制器[self.navigationController popViewControllerAnimated:YES];2> 跳到具体某一控制器[self.navigationControll 阅读全文
posted @ 2014-01-01 23:32 yuan555 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1 #pragma mark 原生加载JSON 2 - (void)loadJSON 3 { 4 // 1. NSURL 5 NSURL *url = [NSURL URLWithString:@""]; 6 7 // 2. NSURLRequest 8 NSURLRequest *request = [NSURLRequest requestWithURL:url]; 9 10 // 3. NSURLConnection11 [NSURLConnection sendAsynchronousRequest:request q... 阅读全文
posted @ 2014-01-01 13:57 yuan555 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 1.以选项卡的形式展示多个子控制器2.设置需要显示的子控制器1> 设置子控制器数组NSArray *viewControllers;2> 逐个添加子控制器// 通过这个方法添加的子控制器会自动添加到viewControllers数组中- (void)addChildViewController:(UIViewController *)childController;3.设置子控制器对应标签的文字和图片* 通过子控制器的tabBarItem属性设置tb.tabBarItem.title = @"最近"; // 设置标题tb.tabBarItem.image = [ 阅读全文
posted @ 2013-12-30 23:49 yuan555 阅读(146) 评论(0) 推荐(0) 编辑