我正在使用 UIPageViewController 并且我已经制定了自己的协议(protocol),如下所示:
@protocol MyDataDelegate <NSObject, UIPageViewControllerDelegate>
- (void)recieveData:(NSString *)theData;
@end
如何将 UIPageViewController 的委托(delegate)设置为 self 以便我可以使用这些委托(delegate)方法?正常的代码是 self.delegate = self;
但由于我已经做了另一个代表,它给了我一个警告 "Assigning to 'id<MyDataDelegate>' from incompatible type 'PageScrollViewController *const_strong'"
我想将其设置为 self,以便我可以访问 UIPageViewController 的委托(delegate)方法
最佳答案
您的子类使 UIPageViewController 的委托(delegate)属性黯然失色。为您的委托(delegate)属性指定其他名称,例如:@property (nonatomic,weak) id myDelegate;
关于iphone - 创建协议(protocol)后访问 UIPageViewController 的委托(delegate)方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16301817/