我已在文件ScrollableTimelineViewProtocol
中声明了一个名为ScrollableTimelineView.h
的协议,如下所示:
#import <UIKit/UIKit.h>
#import "AbstractView.h"
#import "RedTimeIndicator.h"
#import "EventsModel.h"
#import "TimeStrands.h"
#define LABEL_TAG_OFFSET -500
@protocol ScrollableTimelineViewProtocol <NSObject>
- (void) showPopup : (NSInteger)tag;
@end
@interface ScrollableTimelineView : UIView<TimeStrandDelegate,UIScrollViewDelegate>
{
}
@property (nonatomic,assign) id<ScrollableTimelineViewProtocol> delegate;
我正在尝试在视图控制器中使用它:
#import <UIKit/UIKit.h>
#import "AbstractViewController.h"
#import "TimeStrands.h"
#import "ScrollableTimelineView.h"
@protocol TimelineDelegate <NSObject>
- (void) detailedShownDelegate;
- (void) detailedViewHiddenDelegate;
@end
@interface TimelineViewController : UIViewController<ScrollableTimelineViewProtocol>;
但我收到错误Could not find protocol declartion for ScrollableTimelineViewProtocol
。帮助
答案 0 :(得分:1)
答案 1 :(得分:1)
@protocol scrollableTimelineViewProtocol;
@property (strong, nonatomic) IBOutlet UITableView *tblView;
@property (strong, nonatomic) IBOutlet id<scrollableTimelineViewProtocol> delegate;
@end
@protocol scrollableTimelineViewProtocol <NSObject>
-(void)runFast;
@end
答案 2 :(得分:0)
只是简单......试试这个......
从
@interface TimelineViewController : UIViewController<ScrollableTimelineViewProtocol>;
向
@interface TimelineViewController : UIViewController<ScrollableTimelineViewProtocol>