写法1:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. if ([segue.identifier isEqualToString:@"ProjectDetailsSegue"]) { ProjectDetailsViewController *detailsVC = segue.destinationViewController; detailsVC.idString = sender; }
写法2:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. if ([[segue destinationViewController] isKindOfClass:[EZWifiConfigViewController class]]) { ((EZWifiConfigViewController *)[segue destinationViewController]).ssid = self.nameTextField.text; ((EZWifiConfigViewController *)[segue destinationViewController]).password = self.passwordTextField.text; } }
时间: 2024-10-04 07:09:21