저는 웹 서비스에서 이미지를 표시하기 위해 AQGridView를 사용하고 있습니다. 셀을 터치하면 didSelectItemAtIndex
대리자가 호출되지 않습니다. numberOfItemsInGridView
대리인이 호출되었으므로 대리자 및 데이터 소스 설정이 필요하다고 생각합니다. 여기에 코드입니다 :AQGridView didSelectItemAtIndex 대리자가 호출되지 않았습니다.
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
PhotoGridViewController.m
#import "PhotoGridViewController.h"
#import "PhotoGridViewCell.h"
#import "AQGridViewCell.h"
@interface PhotoGridViewController()
@end
@implementation PhotoGridViewController
@synthesize imageDictionaries = _imageDictionaries;
@synthesize gridView=_gridView;
@synthesize gridViewCellContent = _gridViewCellContent;
... 헬퍼 방법, 세포 생성 및 이미지 가져 오는 방법은 ...
- (NSUInteger) numberOfItemsInGridView: (AQGridView *) aGridView
{
return ([self.imageDictionaries count]);
}
^^^이 대리자 메서드 은입니다. NSLog 문을 호출하지 ^^^ ...
-(void)gridView:(AQGridView *)gridView didSelectItemAtIndex:(NSUInteger)index {
NSLog (@"Selected theArgument=%d\n", index);
}
. 저는이 프로젝트 (http://fdiv.net/2011/10/29/reusable-views-ios)를 광산 제작의 가이드로 사용했습니다. 그 중 하나는 잘 작동합니다. 나는 두 가지를 모두 디버깅하고 발사부터 셀을 만지기까지 각 단계를 밟았으며 어디에서 잘못 될지 알 수 없습니다. 바라기를 이것은 내가 볼 수없는 명백한 것입니다.
편집 :이 감동 도착하면이 라인
cell.selectionStyle = AQGridViewCellSelectionStyleGlow;
는 세포의 변화를 보여주기 때문에 세포가 선택 얻고있다.
I KNEW IT !!!! 엄청 고마워. dataSource를 설정했지만 대리자는 설정하지 않았습니다. 항상 간단한 물건입니다. – Eric