摘要:
1.GCD常用的代码#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // ... 阅读全文
摘要:
1.pthread#import "ViewController.h"#import @interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad];... 阅读全文
摘要:
1.Copy/* 自定义类实现copy的功能: 1) 创建一个类 2) 遵守NSCopying协议 3) 实现协议中声明的方法 4) [对象 copy]; 目的: 产生一个副本对象 */#import @interface Dog : NSObject@p... 阅读全文
摘要:
1.NSFileManager的使用#import int main(int argc, const char * argv[]) { @autoreleasepool { //NSFileManager 用于判断 N... 阅读全文
摘要:
1.协议的补充#import //#import "baseProtocol.h"@protocol baseProtocol;//只是告诉编译器有这个协议@interface Dog : NSObject@end2.NSString的比较#import void test(){ NSStri... 阅读全文
摘要:
1.block的基本使用#import int main(int argc, const char * argv[]) { @autoreleasepool { //1.无参数 无返回值 ... 阅读全文
摘要:
1.autorelease注意及错误用法#import #import "Person.h"/** * autorelease的使用注意 */void test(){ //1 自动释放池 Person *p = [Person new]; @autoreleasepool { ... 阅读全文
摘要:
1.OC的内存管理 ---任何对象都有可能拥有一个或者多个拥有者,只要一个对象至少还有一个拥有者,它就会继续存在 /* 1 引用计数器: 用来保存当前对象有几个东西在使用它(数字) 2 引用计数器的作用: 用来判断对象是否应该回收内存空间(如果对象... 阅读全文