`
mrjeye
  • 浏览: 178093 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

嗯,就是内存方面的

 
阅读更多
UIScrollView* scroll = [[UIScrollView alloc] init];
    
    NSLog(@"scroll retain count 1 is %d", [scroll retainCount]);
    
    ControlPanel* cp = [[ControlPanel alloc] init];
    
    NSLog(@"control panel retain count 1 is %d", [cp retainCount]);
    
    [scroll addSubview:cp];
    
    NSLog(@"control panel retain count 2 is %d", [cp retainCount]);
    
    NSLog(@"scroll retain count 2 is %d", [scroll retainCount]);
    
    [scroll release];
    NSLog(@"control panel retain count 3 is %d", [cp retainCount]);
    NSLog(@"scroll retain count 3 is %d", [scroll retainCount]);
    
    [cp release];

    return NO;


2011-08-18 09:57:25.352 wolaidianDemo[3280:607] scroll retain count 1 is 1
2011-08-18 09:57:33.784 wolaidianDemo[3280:607] control panel retain count 1 is 1
2011-08-18 09:57:38.320 wolaidianDemo[3280:607] control panel retain count 2 is 2
2011-08-18 09:57:41.218 wolaidianDemo[3280:607] scroll retain count 2 is 1
2011-08-18 09:57:44.414 wolaidianDemo[3280:607] control panel retain count 3 is 1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics