Próbowałem wyszukać kilka samouczków dotyczących wypełniania widoków tabel, ale znalazłem tylko stare i nieaktualne filmy. Próbowałem zrobić to od nieco nowszego i to nie działa. MamWypełnianie komórek widoku tabeli w systemie iOS 6
- (void)viewDidLoad
{
[super viewDidLoad];
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
[chemarray addObject:@"2"];
[chemarray addObject:@"test"];
[chemarray addObject:@"3"];
[chemarray addObject:@"science"];
}
i
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [chemarray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
cell.textLabel.text = [chemarray objectAtIndex:indexPath.row];
return cell;
}
według tego poradnika, po uruchomieniu, należy wyświetlić elementy w moim tablicy, ale dla mnie to nie robi! Czy ktoś wie, jak to naprawić?
ustawiłeś kontroler widoku jako delegat widoku tabeli? Czy tworzy komórkę, czy nie? –
nie tworzy komórki – Alexyuiop