Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ViewDidLoad executes slowly while pushing viewcontroller

I was trying to push a viewcontroller B into navigation controller from A and then assigning some properties of B in A.
In this case, the assigning of properties was done and then viewDidLoad of viewcontroller A was executed.

Here, assigning properties in A should be done only after viewDidLoad of A has done.

For example,

[b.navController pushViewController:a animated:YES];
a.status = @"loaded";

Here, status was assigned first and then viewDidLoad of A was executed. This happens only in iOS 7 whereas in iOS6 it works fine.

Can anyone please let me know where the problem is?

UPDATE: For me in some cases in iOS7, Push view is not working. How cna I debug and fix it?

like image 727
satyanarayana Avatar asked Oct 02 '13 21:10

satyanarayana


1 Answers

Just access the viewcontroller.view (set any thing immediately after the alloc) property after the alloc init;

Which will loadview/viewdidload.
See Apple Documentation

like image 70
Hiren Avatar answered Oct 10 '22 09:10

Hiren