私のiPhoneアプリケーションには、テーブルビューがあります。
- (NSInteger)tableView:(UITableView *)tableView_ numberOfRowsInSection:(NSInteger)section
{
return 2;
}
しかし- (UITableViewCell *)tableView:(UITableView *)tableView_ cellForRowAtIndexPath:(NSIndexPath *)indexPath;
、ios 7 では 1 回しか呼び出しません。この問題を解決するにはどうすればよいですか?
tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 158) style:UITableViewStylePlain];
[self.view addSubview:tableView];
tableView.delegate = self;
tableView.dataSource = self;
tableView.scrollEnabled = NO;
[tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(CGFloat)tableView:(UITableView *)tableView_ heightForRowAtIndexPath:(NSIndexPath *)indexPath{
switch (indexPath.row)
{
case 0: return 98;
default: return 60;
}
}