UITableView コントロールを備えた単純なテーブル ビュー コントローラーがあります。ヘッダー ファイルに UITableViewDelegate と UITableViewDatasource を実装しました。データ ソースとデリゲートを、UITableView を含む ViewController に割り当てました。ただし、どのテーブル ビュー メソッドも起動していません。ソース コードを削除したものと、デリゲート/データソースを示すスクリーン ショットを投稿しました。イベントが配線されない理由として考えられるのは何ですか?
(gauges は値オブジェクトの NSArray を含むモデルです)
ヘッダ
#import <UIKit/UIKit.h>
#import "GaugeList.h"
@interface SitePickerViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic,strong) GaugeList *gauges;
@end
実装
#import "SitePickerViewController.h"
@interface SitePickerViewController ()
@end
@implementation SitePickerViewController
@synthesize gauges;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
}
return self;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
NSInteger rowCount = [gauges.gaugeList count];
NSLog(@"numberOfRowsInSection called: %i\n", rowCount);
return rowCount;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
NSLog(@"cellForRowAtIndexPath\n");
UITableViewCell *cell = [[UITableViewCell alloc] init];
return cell;
}
-(void)loadView{
gauges = [[GaugeList alloc] initWithStateIdentifier:@"WV" andType:nil];
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
NSLog(@"viewDidLoad called: %i\n", [gauges.gaugeList count]);
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end