Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The views of <code>secondViewController</code> have not been loaded yet when you set them. You can verify this by querying for the value of <code>secondViewController.titleHeader</code> after pushing the view controller to the navigation stack.</p> <p>As a fix, you can declare a property in <code>secondViewController</code></p> <pre><code>@property (nonatomic, strong) NSString *titleHeaderText; </code></pre> <p>then set that property instead of <code>secondViewController.titleHeader setText</code><br> e.g.</p> <pre><code>secondViewController.titleHeaderText = [object name]; </code></pre> <p>After that, in your <code>secondViewController</code>'s <code>viewDidLoad</code> method, you can set the text of your label.</p> <pre><code>[self.titleHeader setText:self.titleHeaderText ]; </code></pre> <p><strong>EDIT:</strong><br> The behavior of <code>pushViewController</code> seems to have changed in iOS 7. I have tried and replicated your issue.</p> <p>If you do not want the above change, a workaround is by accessing the view of <code>secondViewController</code>, so that its views will be loaded before you call <code>label setText</code>.<br> e.g. </p> <pre><code>SecondViewController *secondViewController = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil code:[object code]]; [self.navigationController pushViewController:secondViewController animated:YES]; [secondViewController view]; [secondViewController.titleHeader setText:[object name]]; [secondViewController.headerView setBackgroundColor:colorHeaderGallery]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload