Ios 为什么不调用我的委托方法?
我正在使用CFViewController,我需要调用委托方法 cfc OverflowView.hIos 为什么不调用我的委托方法?,ios,objective-c,delegates,Ios,Objective C,Delegates,我正在使用CFViewController,我需要调用委托方法 cfc OverflowView.h @class CFCoverFlowView; @protocol CFCoverFlowViewDelegate <NSObject> @optional - (void)coverFlowView:(CFCoverFlowView *)coverFlowView didScrollPageItemToIndex:(NSInteger)index; - (void)coverFl
@class CFCoverFlowView;
@protocol CFCoverFlowViewDelegate <NSObject>
@optional
- (void)coverFlowView:(CFCoverFlowView *)coverFlowView didScrollPageItemToIndex:(NSInteger)index;
- (void)coverFlowView:(CFCoverFlowView *)coverFlowView didSelectPageItemAtIndex:(NSInteger)index;
@end
@interface CFCoverFlowView : UIControl
@property (nonatomic, weak) id <CFCoverFlowViewDelegate> delegate;
@class CFCoverFlowView;
@interface CFViewController : UIViewController <CFCoverFlowViewDelegate>{
int contador;
CFCoverFlowView *coverFlowView2;
}
我需要在滚动页面时调用最后两个函数。比如当你有一个UITableView
并且它调用这个函数-(void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(nsindepath*)indepath
有人能帮我吗?
感谢您的支持。添加此行:
[coverFlowView2 setDelegate:self];
您已经在
CFViewController
中初始化了coverFlowView2
当我滚动页面时,应该调用函数didcrollpageitemtoindex
no?就像当你有一个UITableView
被称为didYouSelectItem。。。不,不,这有什么区别-(void)tableView:(UITableView*)tableView没有选择rowatindexpath:(nsindepath*)indepath
事实上,我想我搞错了;很抱歉
[coverFlowView2 setDelegate:self];