IOS内存泄漏

1、

1- (void)viewDidLoad

{

    [superviewDidLoad];

    self.view.frame=CGRectMake(0, 0, 320, 500);

    NSArray *title1=[[NSArrayalloc]initWithObjects:@"知识库",@"网络医院",@"账务管理",@"客户管理",@"日常安排",@"代理人", nil];

    NSArray *title2=[[NSArrayalloc]initWithObjects:@"我的账号",@"个人信息",@"积分",@"积分上传", nil];

   ///内存泄漏
修改:
[title1 release];
[title2 release];
titile=[[NSMutableArray alloc]initWithObjects:title1,title2, nil]; }

2、

method returns an objective-c object with a +1 retain count

- (void)logout:(UIButton*)sender
{
    YCAppDelegate *app =  (YCAppDelegate*)[[UIApplication sharedApplication] delegate];
    YCLoginViewController *login = [[YCLoginViewController alloc]init];
  
   //内存泄漏
    [app.navigationController pushViewController:login animated:YES];
   
}

 

posted @ 2013-10-28 19:58  ymonke  阅读(224)  评论(0编辑  收藏  举报