release view from NavViewController

Discussion in 'iPhone/iPad Programming' started by Nnavick, Apr 18, 2011.

  1. Nnavick, Apr 18, 2011
    Last edited by a moderator: Apr 18, 2011

    macrumors regular

    Joined:
    Oct 13, 2010
    #1
    Hi,

    When a tableView cell is selected i did

    Code:
     [naccontroller pushViewController:newView animated:YES];
    and when the newView's viewDidLoad method lunching I did
    Code:
    NsLog(@"Bla");
    but it's happening only one time at runtime,

    When I clicked on the back button and did
    Code:
      [self.navigationController popViewControllerAnimated:YES];
    the view disappear but when I click again on the cell and the newView popup again ,
    the "viewDidLoad,viewWillAppear or the viewDidAppear method don't work
    even I did on the dealoc method
    Code:
    self.view release;
    what is the problem?

    thanks

    EDIT:

    I solved it,
    When the back button is hit I changed the view property to nil :)
     
  2. jnoxx, Apr 18, 2011
    Last edited by a moderator: Apr 18, 2011

    macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    You know what the problem is.
    Viewdidload and viewwillappear :)
    Viewdidload will only launch once in a navigation, because it gets added on the stack.
    A viewwillappear will show up each time, without setting properties to nil ;)

    Code:
    - (void) viewWillAppear:(BOOL)animated {
    }
     

Share This Page