我刚开始学习,所以请放轻松...
目标是获取选取器中所选行的文本值,并将其显示在另一个视图的标签中。
现在我很难存储字符串值,一切都编译和加载,但第二个视图中的标签保持空白。请让我去noobify。
//String taken from selected pickerview line and stored in selectedstring
NSString *string = [NSString stringWithFormat:@"You Selected: %@",[_platforms objectAtIndex:row]];
Selectedstring.text = string;
在“下一个视图”按钮按下:
- (IBAction)NextView:(id)sender {
SecondView *secondview = [[SecondView alloc]init];
self.SecondViewData = secondview;
SecondViewData.passedValue = Selectedstring.text;
[self presentViewController:secondview animated:YES completion:nil];
然后在下一个视图的“viewdidload”区域中,我有:
label.text = passedValue;