Ошибка при загрузке UITableView - PullRequest
0 голосов
/ 02 февраля 2012
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.nameList.count;

}
-(UITableViewCell *)tableview:(UITableView *)tableview cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *CellIdentifier=@"Cell";

    UITableViewCell *cell=[tableview dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell==nil) {

        cell=[[UITableViewCell alloc]initWithFrame:CGRectZero reuseIdentifier:CellIdentifier];
        //cell = [[UITableViewCell alloc]
        //   initWithStyle:UITableViewCellStyleDefault
        // reuseIdentifier:CellIdentifier];

    }
    //Setup the cell
     NSString *cellValue=[ListofItems objectAtIndex:indexPath.row];
    cell.text=cellValue;
    cell.textLabel.text = [self.nameList              objectAtIndex: [indexPath row]];

    return cell;

}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

Привет, ребята, у меня есть эти коды, и я не вижу свои значения в моем табличном представлении.? И это говорит: «Программа получила сигнал sigabrt». Вы можете помочь мне, где моя ошибка?

1 Ответ

0 голосов
/ 03 февраля 2012
 return self.nameList.count; 

какое значение nameList.count при вызове tableview numberOfRowsInSection?Попробуйте установить его на фиксированное значение только для проверки.Возможно, вы неправильно настраиваете список имен.

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;

}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...