首先,我想强调一下,这段代码是有效的,但看起来很糟糕。我需要以编程方式更改ViewController(不能使用segue),所以我使用以下代码:NSString*storyboardName=@"Main";UIStoryboard*storyboard=[UIStoryboardstoryboardWithName:storyboardNamebundle:nil];PurchaseViewController*vc=[storyboardinstantiateViewControllerWithIdentifier:@"PurchaseViewController"];[cont