#import "ViewController.h" #import "EOCNetworkFetcher.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. /* ARC下不能调用 * retain,release,autorelease,dealloc方法 * * */ //用 __weak 局部变量打破 block的保留环 NSURL *url = [NSURL URLWithString:@"http://wwww.icoding.com"]; EOCNetworkFetcher *fetcher = [[EOCNetworkFetcher alloc]initWithURL:url]; EOCNetworkFetcher * __weak weakFetcher = fetcher; // [fetcher startWithCompletion:^(BOOL success){ // // }]; //ARC只负责管理OC对象的内存。尤为注意CoreFoundation对象不归ARC管理,开发者必须适时调用CFRetain/CFRelease //http://www.cnblogs.com/worldtraveler/p/4585284.html } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end