繁体   English   中英

无法将自定义类分配给Page View Controller

[英]Can't assign custom class to Page View Controller

我正在使用情节提要,并添加了一个页面视图控制器,现在我想对其进行配置以使用自己的自定义类。 为此,我选择了页面视图控制器,该控制器指示在Identity Inspector下的Custom Class中使用UIPageViewController。 我设置了自己的WinkPageViewController,但出现“碰撞”声音,再次取消选择+选择视图控制器,表明该属性已重置为先前的值。

我不确定代码的哪些部分将是相关的,因此暂时将其保留在此处,但请告知我是否还有与此相关的内容。

@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

我知道我没有实现UIPageViewControllerDelegate可选方法(恰好是所有这些方法),但是我之前已经迅速做到了这一点,并且有效。 我该怎么办?

正方形是矩形,但矩形可能不是正方形

页面视图控制器 (来自情节提要中的对象库)表示UIPageViewController

视图控制器 (来自情节提要中的对象库)表示UIViewController

WinkPageViewController继承自UIViewController ,不能表示Page View Controller对象的自定义类。


UIPageViewController类参考

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM