Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/100.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 为什么不调用我的委托方法?_Ios_Objective C_Delegates - Fatal编程技术网

Ios 为什么不调用我的委托方法?

Ios 为什么不调用我的委托方法?,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

我正在使用CFViewController,我需要调用委托方法

cfc OverflowView.h

@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];