Memory Problem

Discussion in 'iOS Programming' started by testgame, Aug 18, 2010.

  1. macrumors newbie

    Joined:
    Jun 9, 2010
    #1
    Hello,

    I have memory problem in my application. I am integrating some application in one application.

    Following is my problem:
    -I have one UIView named MainView.
    At this time memory usage is 9.0 mb.

    -now i am adding another view on it.
    Memory usage increase to 13-15 mb.

    - When i release that newly added view from superview. [self removefromsuperview];
    Memory is 9.5 mb. it's not 9.0 mb.

    - As i open more views memory increases.

    I release all the objects & controls i take in that view.

    Pls help me to solve this problem.

    Thanks in Advance.
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Without the code it is impossible to help: you are most likely allocating memory and not releasing it.
     
  3. macrumors newbie

    sherry2009

    Joined:
    Dec 14, 2009
    #3
    Are you release it

    release that newly added view ,not just [self removefromsuperview],also [newly_added_view release];Are you release it?
     
  4. thread starter macrumors newbie

    Joined:
    Jun 9, 2010
    #4
    Thanks for your reply.

    I have one mainView. It contains button 1 to 5.

    When I click on button 1, I write following code.

    view1 *view = [[view1 alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
    [self.superview addSubview:view];
    [view release];

    & in view1 i write [self removeFromSuperView]; To go back to mainView.
    I release all the objects i took in view1.

    At this time memory problem occurs. As I click on more buttons & add more views memory increases even i m removing it.
     

Share This Page