0

my question is that i use ios 4.1 and viewWillAppear is not call when i go via

[self.view addSubView:self.mySecondView.view];

then and in the first view i alloc second view on ViewDidLoad .. i just want to call ViewWillApear on Second View because want to do the task dynamic.

is their some thing alternative... because InitWithNibName method also fire when alloc and init occur.. i want to fire some method when i add to that view.

Thanks

Jhaliya - Praveen Sharma
  • 31,697
  • 9
  • 72
  • 76
Appz Venture
  • 939
  • 1
  • 13
  • 28
  • 1
    I think that you are confusing the purpose of the view and the view controller. Looks to me like mySecondView is a view controller and just instantiating a view controller and adding its view to another view does not work as expected (I partially blame UIWindow's original implementation of addSubview on this misconception). You may need to rethink your design. – Joe Apr 20 '11 at 19:25