Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You don't see anything happened because you create <strong>new instance</strong> of label and do not add it anywhere. If you really want to add new label to your view then create it with appropriate frame and actually add it to some view, e.g.</p> <pre><code>-(void)setOne:(NSMutableArray *)theArray { label1 = [[UILabel alloc] initWithFrame:CGRectMake(10.0f, 10.0f, 200.0f, 30.0f)]; label1.text = @"Test"; [self.view addSubview: label1]; // And do not forget to release your label! [label1 release]; } </code></pre> <p>If you want to change text of label that already exists do not create new instance in your method, just set new text to it:</p> <pre><code>-(void)setOne:(NSMutableArray *)theArray { // if label1 already exists we don't need to create a new one label1.text = @"Test"; } </code></pre> <p><strong>Edit:</strong> (from more info in comments)</p> <p>When you create view controller it may not load its view immediately so in your code</p> <pre><code>FirstViewController *FVC = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil]; [FVC setOne:[resultaten objectAtIndex:indexPath.row]]; </code></pre> <p>when you call setOne method fvc's view may still not be loaded and label1 is still nil in that method. You can solve that forcing controller's view to load, the following should work:</p> <pre><code> FirstViewController *FVC = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil]; FVC.view; [FVC setOne:[resultaten objectAtIndex:indexPath.row]]; </code></pre> <p>But in general I'd suggest to store your values in some class that's independent from UI (i.e. Model) or at least in separate variable of your controller and set it to UI elements only when they actually loaded or appear on screen (in viewDidLoad or viewWillAppear methods)</p>
    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. This table or related slice is empty.
    1. 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