解决方案 »

  1.   

      但是我写了个demo,就上面的代码,界面反复切换进入的话,内存还是在0.1M为单位往上涨啊?
      

  2.   

    把你上下文的代码发下 我写的很简单  就两段代码      UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 320, 40)];
        button.backgroundColor = [UIColor brownColor];
        [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [button setTitle:@"返回" forState:UIControlStateHighlighted];
        [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:button];
        [button  release];    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 50, 320, 480)];
        NSString *bundleStr = [[NSBundle mainBundle] resourcePath];
        NSString *path = [[NSString alloc] initWithFormat:@"%@/%@.png", bundleStr, @"HomePageBkg"];
        UIImage *image = [[UIImage alloc] initWithContentsOfFile:path];
        [imageView setImage:image];[path release];[image release];
        [self.view addSubview:imageView];
        [imageView release];
      

  3.   

    用WebImage 那个第三方试试。
      

  4.   

    NSString *path把这个设置成属性,copy试试,第一行代码前面改成self.path试试,一般用到NSString都会给设置成属性,你这样,容易内存泄露。
      

  5.   

    path没有释放掉,你使用alloc构建,然后没有release;image也没有释放掉,也是使用alloc构建,没有release。而使用UIImage *image = [UIImage imageNamed:@"SetInfoTitleTxt"];构建这是个类方法,类方法自带autoRelease的
      

  6.   

    坑爹了,后面写了release没看到