Note that there are some explanatory texts on larger screens.

plurals
  1. POIOS Segue not able to set label directly
    primarykey
    data
    text
    <p>I am having two view controllers 'FirstViewController' and 'SecondViewController'. From first view controller it will take input from a text field ,process it and display accordingly in the second view. But I am having a problem while setting label value directly.</p> <pre><code> @interface SecondViewController : UIViewController { NSString *numPlate; IBOutlet UILabel *output; }; @property(strong,nonatomic) NSString *numPlate; @property(strong,nonatomic) IBOutlet UILabel *output; @end </code></pre> <p>The main file for FirstViewController.m with prepare for segue is as</p> <pre><code>-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if([[segue identifier] isEqualToString:@"Change"]) { SecondViewController *svc = (SecondViewController *)[segue destinationViewController]; svc.numPlate = input.text; NumberPlate *numPlate=[[NumberPlate alloc]init]; [numPlate setPlate:input.text]; NSInteger flag=[numPlate checkValidity]; if(flag==0) { svc.output.text =@"Invalid License"; } else if([numPlate getArea]==NULL||[numPlate getRegOffice]==NULL) { svc.output.text =@"Data not found"; } else { svc.output.text =@"VALID License"; } } } </code></pre> <p>But when the action is performed its not working.The label is not changing. When i used svc.numPlate instead of svc.output.text and in the SecondViewController viewDidLoad method and i used </p> <pre><code> - (void)viewDidLoad { [super viewDidLoad]; output.text=numPlate; } </code></pre> <p>Everything is fine with this. Whats wrong in first method??</p>
    singulars
    1. This table or related slice is empty.
    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. 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