Objective c 未调用AQGridView didSelectItemAtIndex委托
我正在使用AQGridView显示来自web服务的图像。当我触摸单元格时,不会调用Objective c 未调用AQGridView didSelectItemAtIndex委托,objective-c,ios,cocoa-touch,aqgridview,Objective C,Ios,Cocoa Touch,Aqgridview,我正在使用AQGridView显示来自web服务的图像。当我触摸单元格时,不会调用didSelectItemAtIndex委托。调用了numberOfItemsInGridView委托,因此我想我已经完成了委托和数据源设置。代码如下: PhotoGridViewController.h #import "AQGridView.h" #import "PhotoGridViewCell.h" @interface PhotoGridViewController : UIViewControlle
didSelectItemAtIndex
委托。调用了numberOfItemsInGridView
委托,因此我想我已经完成了委托和数据源设置。代码如下:
PhotoGridViewController.h
#import "AQGridView.h"
#import "PhotoGridViewCell.h"
@interface PhotoGridViewController : UIViewController<AQGridViewDelegate,AQGridViewDataSource>
@property (nonatomic, strong) NSArray *imageDictionaries;
@property (weak, nonatomic) IBOutlet AQGridView *gridView;
@property (nonatomic, retain) IBOutlet PhotoGridViewCell *gridViewCellContent;
-(void)refreshImages;
@end
。。。助手方法、单元格创建和图像获取方法
- (NSUInteger) numberOfItemsInGridView: (AQGridView *) aGridView
{
return ( [self.imageDictionaries count] );
}
^^^已调用此委托方法^^^
永远不会调用NSLog语句。我用这个项目来指导我的工作。那只很好用。我对这两个都进行了调试,从启动到触摸手机的每一步都是一步一步地进行的,我无法找出哪里出了问题。希望这是我没有看到的明显的东西
编辑:单元格被选中,因为此行
cell.selectionStyle = AQGridViewCellSelectionStyleGlow;
触摸单元格时显示单元格更改。您必须设置代理。我打赌你忘了
self.gridView.delegate = self;
self.gridView.dataSource = self;
我就知道!!!!非常感谢。我设置了数据源,但没有委托。事情总是简单的。
cell.selectionStyle = AQGridViewCellSelectionStyleGlow;
self.gridView.delegate = self;
self.gridView.dataSource = self;