摘要: 1.GCD常用的代码#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // ... 阅读全文
posted @ 2015-11-12 15:00 ios开发那点事 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1.pthread#import "ViewController.h"#import @interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad];... 阅读全文
posted @ 2015-11-03 15:52 ios开发那点事 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 1.Copy/* 自定义类实现copy的功能: 1) 创建一个类 2) 遵守NSCopying协议 3) 实现协议中声明的方法 4) [对象 copy]; 目的: 产生一个副本对象 */#import @interface Dog : NSObject@p... 阅读全文
posted @ 2015-10-29 15:38 ios开发那点事 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 1.NSFileManager的使用#import int main(int argc, const char * argv[]) { @autoreleasepool { //NSFileManager 用于判断 N... 阅读全文
posted @ 2015-10-29 13:50 ios开发那点事 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 1.协议的补充#import //#import "baseProtocol.h"@protocol baseProtocol;//只是告诉编译器有这个协议@interface Dog : NSObject@end2.NSString的比较#import void test(){ NSStri... 阅读全文
posted @ 2015-10-28 17:46 ios开发那点事 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 1.block的基本使用#import int main(int argc, const char * argv[]) { @autoreleasepool { //1.无参数 无返回值 ... 阅读全文
posted @ 2015-10-28 16:14 ios开发那点事 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1.autorelease注意及错误用法#import #import "Person.h"/** * autorelease的使用注意 */void test(){ //1 自动释放池 Person *p = [Person new]; @autoreleasepool { ... 阅读全文
posted @ 2015-10-28 14:21 ios开发那点事 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1.OC的内存管理 ---任何对象都有可能拥有一个或者多个拥有者,只要一个对象至少还有一个拥有者,它就会继续存在 /* 1 引用计数器: 用来保存当前对象有几个东西在使用它(数字) 2 引用计数器的作用: 用来判断对象是否应该回收内存空间(如果对象... 阅读全文
posted @ 2015-10-27 20:36 ios开发那点事 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 1.动态类型检测方法/* 动态类型检测的方法 1)判断对象所属关系 (1)判断某一个对象是否是指定类或者该类的子类的对象 (2)判断某一个对象是否是指定的类的实例对象 (3)判断某一个类是否是指定类 的子类 2)判断能否响应方法 ... 阅读全文
posted @ 2015-10-19 14:23 ios开发那点事 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 1.点语法/* 点语法: 通过 实例对象名.成员变量 的方式获取或者设置成员变量值得形式,就是点语法 1)点语法获取成员变量值的格式: 点语法格式,出现在了等号的右侧 NSString *str = p.name; //获取变量名 ... 阅读全文
posted @ 2015-10-19 13:41 ios开发那点事 阅读(147) 评论(0) 推荐(0) 编辑