Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 加载UITableView时出错_Objective C_Xcode_Tableview - Fatal编程技术网

Objective c 加载UITableView时出错

Objective c 加载UITableView时出错,objective-c,xcode,tableview,Objective C,Xcode,Tableview,大家好, 我有这些代码,在我的tableview中看不到我的值。上面写着:“程序接收信号sigabrt” 你能帮我一下我的错在哪里吗 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.nameList.count; } -(UITableViewCell *)tableview:(UITableView *)tableview ce

大家好, 我有这些代码,在我的tableview中看不到我的值。上面写着:“程序接收信号sigabrt” 你能帮我一下我的错在哪里吗

- (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;
}
调用tableview numberOfRowsInSection时,哪个是nameList.count的值?尝试将其设置为固定值以进行测试。可能您没有正确设置名称列表

 return self.nameList.count; 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;

}