Afficher une tableview dans une scrollview
Bonjour,
j'ai une scrollview définie dans un fichier et je voudrais afficher une tableview avec 4 éléments, mais je n'arrive pas a faire apparaitre cette tableview :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.text = [NSString stringWithFormat:@"TEXTE ICI"];
return cell;
}
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 4;
}
- (void)initIHM{
//ELEMENTS DE LA VUE PRINCIPALE
scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, wVue, self.view.frame.size.height)];
scrollView.backgroundColor = backColor;
scrollView.scrollEnabled = YES;
scrollView.delegate = self;
UITableView * table = [[UITableView alloc] init];
[scrollView addSubview:table];
} |
est ce que j'ai oublié quelque chose ? comment "remplir" les lignes de ma tableview ?
merci d'avance