/examplesフォルダーのImageDemoに基づいてAQGridViewを実装しようとしています。次の宣言を持つViewControllerがあります。
@interface ImageDemoViewController : UIViewController <AQGridViewDelegate, AQGridViewDataSource, ImageDemoCellChooserDelegate>
{
...
私のViewControllerのデータソースメソッドはどれも
- (NSUInteger) numberOfItemsInGridView: (AQGridView *) aGridView
{
return ( [images count] );
}
呼ばれています。ここで、グリッドビューを設定して、ビューコントローラをグリッドビューのデリゲートにします。
- (void)viewDidLoad
{
[super viewDidLoad];
self.gridView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.gridView.autoresizesSubviews = YES;
self.gridView.delegate = self;
self.gridView.dataSource = self;
images=[[NSMutableArray alloc]init];
[images addObject:@"http://t3.gstatic.com/images?q=tbn:ANd9GcTOXAzFMoK441mcn9V0OemVe_dtAuCpGjBkLrv4rffyOjYIo45BEw"];
[self.gridView reloadData];
}
ブレークポイントを設定した場合
[self.gridView reloadData];
行は実行されますが、AQGridViewのreloadDataメソッドは呼び出されません。ImageDemoとの唯一の違いは、ViewController用の.xibファイルがないことです。何かを接続するのを忘れたため、データソースメソッドが呼び出されませんでしたか?