Я создаю табличное представление при показе 1-10 строк, все работает нормально. Однако при добавлении более 10 строк. Он строит, но в симуляторе он показывает только 10 строк.TableView не показывает более 10 строк
Вот мой код:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.greekLetters=
@[@"CHEM 1100",@"CHEM 2100 ",@"CHEM 3415W",@"CHEM 3511",@"CHEM 3521",@"CHEM 4600",@"PHYS 1150",@"PHYS 2150",@"MATH 1201",@"MATH 1206",@"Adv courses",@"CHEM 2700"];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [self.greekLetters count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *[email protected]"SimpleIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: SimpleIdentifier];
if (cell ==nil) {
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:SimpleIdentifier];
}
cell.textLabel.text=self.greekLetters[indexPath.row];
if(indexPath.row==0) [email protected]"General Chemistry I";
if(indexPath.row==1) [email protected]"General Chemistry II";
if(indexPath.row==2) [email protected]"Analytical Chemistry";
if(indexPath.row==3) [email protected]"Organic Chemistry I";
if(indexPath.row==4) [email protected]"Organic Chemistry II";
if(indexPath.row==5) [email protected]"Physical Chemistry(HP)";
if(indexPath.row==6) [email protected]"General Physics I";
if(indexPath.row==7) [email protected]"General Physics II";
if(indexPath.row==8) [email protected]"Calculus I";
if(indexPath.row==9) [email protected]"Calculus II";
if(indexPath.row==10) [email protected]"pick 5 creit";
if(indexPath.row==11) [email protected]"Introduction to Inorganic Chemistry";
return cell;
}
-(NSIndexPath *) tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath{
return indexPath;
}
ли проблема моего кода или тренажере, пожалуйста? Это потому, что, когда я кладу столик на строительную доску, что-то не так, пожалуйста?
В серии уроков YouTube, на которых вы можете основываться, есть некоторые очень странные вещи :( – Abizern
Да, я просто следую этому учебнику. Но я не вижу никаких проблем в таком простом коде. – user4441082
Вы уверены, что ваш табличный вид полностью находится в рамках раскадровки? Правильно ли вы установили ограничения? – Abizern