objective-c - MGSplitViewController 更改详细 View Controller

标签 objective-c ios cocoa-touch uisplitviewcontroller

使用 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/

相关文章:

iOS 8 : Bundle path changes

objective-c - 使 Swift 类可用于 Interface Builder

ios - 将NSString转换为NSDate并返回不同的格式NSString

ios - 导航 Controller 工具栏中的 UIBarButton

ios - 像日期选择器上的键盘一样的动画与 swift ios 一起出现

ios - 未保存 Transient 属性的 setPrimitiveValue

ios - 一个接一个地执行动画,由 KVO 命中(在异步 URLRequest 之后)

iPhone SDK 3.0 应用内电子邮件 - 更改导航栏色调颜色

Swift 游戏 - 点击并点击 + 按住手势?

ios - 带有 UITableView 示例的 MagicalRecord