passing the value from one class to other class

前端 未结 3 709
无人共我
无人共我 2021-01-26 11:17

I am facing the problem in displaying the value of string of AddNotesViewController Class , in the Label of the DetailsOfPeopleViewController.

3条回答
  •  长发绾君心
    2021-01-26 11:50

    You make it a property, so possibly try using the set method. Also, you need to init your ViewControlelr before setting the value. So:

    DetailsOfPeopleViewController *detail=[[DetailsOfPeopleViewController alloc] init];
    [detail setTestPersonNotesStr:[NSString stringWithFormat:@"%@",txtView.text]];
    

    And I do not see where you actually display this view, you have to be displaying the same instance of this view to actually see the value.

提交回复
热议问题