码迷,mamicode.com
首页 >  
搜索关键字:dealloc    ( 275个结果
【分享】UIViewController生命周期简单归纳
一、调用顺序:1. + (id)alloc 分配内存;2. - (id)init 方法(包括其他-(id)init...方法),只允许调用一次,并且要与 alloc方法 写在一起,在init方法中申请的内存,要在dealloc方法中释放(或者其他地方);3.- (void)awakeFromNib ...
分类:其他好文   时间:2015-07-23 21:45:03    阅读次数:104
Objective-C学习之旅 第二篇
Objective-C学习之旅 第二篇Objective-C 字符串处理//苹果从iOS5开始,就引入了ARC这种内存管理技术,目的就是消除繁琐而容易出错的手工内存管理行为。//如果项目是ARC的,那么就不能调用原来的retain, release, autorelease,而且dealloc也不再...
分类:其他好文   时间:2015-07-22 18:31:04    阅读次数:113
深入解析alloc/retain/release/dealloc实现
首先通过GNUstep上得源代码来叙述各个函数的实现(GNUstep是Cocoa框架的互换框架,二者的行为和实现方式非常相似) GNUstep源代码中NSObject类的alloc方法: id = obj = [NSObject alloc]; /**********************************/ +(id) alloc{ return [self...
分类:其他好文   时间:2015-07-22 10:52:52    阅读次数:112
【转】IOS面试题
1.简述OC中内存管理机制。与retain配对使用的方法是dealloc还是release,为什么?需要与alloc配对使用的方法是dealloc还是release,为什么?readwrite,readonly,assign,retain,copy,nonatomic,atomic,strong,w...
分类:移动开发   时间:2015-07-20 18:32:44    阅读次数:169
IBOutlet & IBAction
IBOutletUILabel*label; 这个label在Interface Builder里被连接到一个UILabel。此时,这个label的retainCount为2。所以,只要使用了IBOutlet变量,一定需要在dealloc或者viewDidUnload里release这个变量。用IB...
分类:其他好文   时间:2015-07-17 00:01:16    阅读次数:153
数据持久化
直接上代码:// // AppDelegate.m // //#import "AppDelegate.h" #import "Person.h" @interface AppDelegate ()@end@implementation AppDelegate- (void)dealloc { [_window release]; [super dealloc]; }- (BOOL...
分类:其他好文   时间:2015-07-14 11:44:28    阅读次数:119
retain的循环引用注意以及@class的使用
本文主要说明了retain循环的循环引用及解决方法。...
分类:其他好文   时间:2015-07-08 00:33:40    阅读次数:163
UI_搭建MVC
新建RootViewController 继承于 UIViewController 新建RootView 继承于 UIView AppDelegate.m 中引入 #import "RootViewController.h"#pragma mark - 重写 #pragma mark dealloc - (void)dealloc { [_window release]; [su...
分类:Web程序   时间:2015-07-04 18:26:34    阅读次数:177
UITableView的创建及使用
个别地方没有释放,自己填入即可#import"AppDelegate.h"@interfaceAppDelegate()@end@implementationAppDelegate-(void)dealloc{[_windowrelease];[superdealloc];}-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions..
分类:其他好文   时间:2015-07-04 17:00:38    阅读次数:105
MVC三层架构
新建ViewController类 继承 UIViewControllerAppDelegate.m#import "ViewController.h" #pragma mark - 重写 #pragma mark dealloc - (void)dealloc { [_window release]; [super dealloc]; } //设置window sel...
分类:Web程序   时间:2015-07-03 00:18:18    阅读次数:171
275条   上一页 1 ... 16 17 18 19 20 ... 28 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!