gpt4 book ai didi

objective-c - 如何静默警告不兼容的属性类型

转载 作者:行者123 更新时间:2023-12-03 17:31:44 25 4
gpt4 key购买 nike

我正在使用RTSPagedView来 self 项目中的 github。这给了我这个警告

  Property type 'id<RTSPagedViewDelegate>' is incompatible with type 'id<UIScrollViewDelegate>' unherited from 'UIScrollView'

@property (nonatomic, assign) IBOutlet id <RTSPagedViewDelegate> delegate;

RTSPagedView.h

应用程序在出现此警告时工作正常。任何人以前遇到过这个或知道解决方案请帮忙。

此链接是 RTSPagedView

//  RTSPagedView.h
// PagedView
// http://github.com/rplasman/RTSPagedView

#import <UIKit/UIKit.h>

@protocol RTSPagedViewDelegate;

@interface RTSPagedView : UIScrollView

@property (nonatomic, assign) IBOutlet id <RTSPagedViewDelegate> delegate;
@property (nonatomic, assign) NSUInteger currentPage;
@property (nonatomic, readonly) NSUInteger numberOfPages;
@property (nonatomic, assign) BOOL continuous;

- (void)resizeBounds:(CGRect)bounds;
- (UIView *)dequeueReusableViewWithTag:(NSInteger)tag;
- (UIView *)viewForPageAtIndex:(NSUInteger)index;
- (void)scrollToPageAtIndex:(NSUInteger)index animated:(BOOL)animated;
- (void)reloadData;
- (NSUInteger)indexForView:(UIView *)view;

@end

@protocol RTSPagedViewDelegate <UIScrollViewDelegate>

- (NSUInteger)numberOfPagesInPagedView:(RTSPagedView *)pagedView;
- (UIView *)pagedView:(RTSPagedView *)pagedView viewForPageAtIndex:(NSUInteger)index;

@optional

- (void)pagedView:(RTSPagedView *)pagedView didScrollToPageAtIndex:(NSUInteger)index;
- (void)pagedView:(RTSPagedView *)pagedView didRecycleView:(UIView *)view;
@end

最佳答案

尝试这样:

@property (nonatomic, assign) IBOutlet id <UIScrollViewDelegate, RTSPagedViewDelegate> delegate;

对我有用。

关于objective-c - 如何静默警告不兼容的属性类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14955995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com