更新时间:2023-02-03 10:00:42
通过在尝试访问其中一个属性之前检查目标视图控制器的类来解决此问题:
This issue is resolved by checking the class of the destination view controller before trying to access one of its properties:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
DestController *vc = segue.destinationViewController;
if ([dvc isKindOfClass:[DestController class]])
dvc.propertyName = @"Property Value";
else
// do something else
}
取自此主题的解决方案。