gpt4 book ai didi

objective-c - MGSplitViewController 更改详细 View Controller

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:44:42 25 4
gpt4 key购买 nike

使用 MGSplitViewController,如何更改细节 View Controller ?声明了一个属性:

@property (nonatomic, retain) IBOutlet UIViewController *detailViewController; // convenience.

执行 splitVC.detailViewController = myVC; 没有效果。相反,我必须执行 splitVC.viewControllers = @[masterVC, myVC];。它有效,但这是正确的方法吗?

谢谢!

最佳答案

你做得对。来自 UISplitViewController引用:

The split view controller has no significant interface of its own. Its job is to manage the presentation of its two child view controllers and transitions between different orientations.

还有:

You must assign two view controllers to a split view controller. Usually you configure these view controllers in a storyboard; if you create a split view controller programmatically, you assign them using the viewControllers property.

关于objective-c - MGSplitViewController 更改详细 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12229351/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com