簡體   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