[英]Can't assign custom class to Page View Controller
I'm using storyboard and I added a Page View Controller, which now I want to configure to use my own custom class. 我正在使用情节提要,并添加了一个页面视图控制器,现在我想对其进行配置以使用自己的自定义类。 For this, I select the page view controller which is indicating to use UIPageViewController in Custom Class under the Identity Inspector.
为此,我选择了页面视图控制器,该控制器指示在Identity Inspector下的Custom Class中使用UIPageViewController。 I set my own, WinkPageViewController, but I get a "bump" sound and deselecting + selecting the view controller again shows the property has been reset to the previous value.
我设置了自己的WinkPageViewController,但出现“碰撞”声音,再次取消选择+选择视图控制器,表明该属性已重置为先前的值。
I'm not sure what parts of the code would be relevant, so I'll leave the interface here, for now, but please let me know if anything else is relevant for this. 我不确定代码的哪些部分将是相关的,因此暂时将其保留在此处,但请告知我是否还有与此相关的内容。
@interface WinkPageViewController : UIViewController <UIPageViewControllerDelegate>
@property (nonatomic, strong) UIPageViewController* pageViewController;
@property (nonatomic, strong) WinkPageModelController* modelController;
//// Sent when a gesture-initiated transition begins.
//- (void)pageViewController:(UIPageViewController *)pageViewController willTransitionToViewControllers:(NSArray *)pendingViewControllers NS_AVAILABLE_IOS(6_0);
//
//// Sent when a gesture-initiated transition ends. The 'finished' parameter indicates whether the animation finished, while the 'completed' parameter indicates whether the transition completed or bailed out (if the user let go early).
//- (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed;
//
//// Delegate may specify a different spine location for after the interface orientation change. Only sent for transition style 'UIPageViewControllerTransitionStylePageCurl'.
//// Delegate may set new view controllers or update double-sided state within this method's implementation as well.
//- (UIPageViewControllerSpineLocation)pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation)orientation;
//
//- (NSUInteger)pageViewControllerSupportedInterfaceOrientations:(UIPageViewController *)pageViewController NS_AVAILABLE_IOS(7_0);
//- (UIInterfaceOrientation)pageViewControllerPreferredInterfaceOrientationForPresentation:(UIPageViewController *)pageViewController NS_AVAILABLE_IOS(7_0);
- (WinkOAuthProfileProviderIdentifier)profileProviderPreference;
- (void)saveProfileProviderPreference:(WinkOAuthProfileProviderIdentifier)preference;
- (NSURL*)profileURLWithProviderIdentifier:(WinkOAuthProfileProviderIdentifier)provider error:(NSError**)error;
- (void)saveProfile:(WinkProfile*)profile error:(NSError**)error;
- (WinkProfileData*)loadProfileWithProviderIdentifier:(WinkOAuthProfileProviderIdentifier)provider error:(NSError**)error;
- (void)didReceiveProfile:(WinkProfile*)profile;
@end
I know I'm not implemented the UIPageViewControllerDelegate optional methods (which happens to be all of them), but I have done this before in swift and it worked. 我知道我没有实现UIPageViewControllerDelegate可选方法(恰好是所有这些方法),但是我之前已经迅速做到了这一点,并且有效。 What should I do?
我该怎么办?
Page View Controller (from the Object library in a Storyboard) represents UIPageViewController
. 页面视图控制器 (来自情节提要中的对象库)表示
UIPageViewController
。
View Controller (from the Object library in a Storyboard) represents UIViewController
. 视图控制器 (来自情节提要中的对象库)表示
UIViewController
。
WinkPageViewController
inherits from UIViewController
and cannot represent the custom class of a Page View Controller object. WinkPageViewController
继承自UIViewController
,不能表示Page View Controller对象的自定义类。
UIPageViewController Class Reference UIPageViewController类参考
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.