Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.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
Iphone 财产';长度';在类型为';id';_Iphone - Fatal编程技术网

Iphone 财产';长度';在类型为';id';

Iphone 财产';长度';在类型为';id';,iphone,Iphone,问题就在这里 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomCell"; CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:

问题就在这里

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"CustomCell";

    CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
        for (id currentObject in topLevelObjects){
            if ([currentObject isKindOfClass:[UITableViewCell class]]){
                cell =  (CustomCell *) currentObject;
                break;
            }
        }
    }
    cell.nameLabel.text = [arrareasdata objectAtIndex:indexPath.row];
    cell.designLabel.text = [arrareasdata1 objectAtIndex:indexPath.row];

    if(([arrareasdata2 objectAtIndex:indexPath.row].length > 0)  
    {
        cell.emailLabel.text = [arrareasdata2 objectAtIndex:indexPath.row]
    }
    else
    {
        cell.emailLabel.text = @"";
    }

    cell.webLabel.text = [arrareasdata3 objectAtIndex:indexPath.row];


    return cell;
}
您必须做的是从数组中获取对象并将其转换为适当的类型。例如,如果数组中的对象是
NSString
类型,则执行以下操作

if(([arrareasdata2 objectAtIndex:indexPath.row].length > 0)
然后在if语句中检查长度

NSString *value = (NSString*)[arrareasdata2 objectAtIndex:indexPath.row];
问题就在这里

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"CustomCell";

    CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
        for (id currentObject in topLevelObjects){
            if ([currentObject isKindOfClass:[UITableViewCell class]]){
                cell =  (CustomCell *) currentObject;
                break;
            }
        }
    }
    cell.nameLabel.text = [arrareasdata objectAtIndex:indexPath.row];
    cell.designLabel.text = [arrareasdata1 objectAtIndex:indexPath.row];

    if(([arrareasdata2 objectAtIndex:indexPath.row].length > 0)  
    {
        cell.emailLabel.text = [arrareasdata2 objectAtIndex:indexPath.row]
    }
    else
    {
        cell.emailLabel.text = @"";
    }

    cell.webLabel.text = [arrareasdata3 objectAtIndex:indexPath.row];


    return cell;
}
您必须做的是从数组中获取对象并将其转换为适当的类型。例如,如果数组中的对象是
NSString
类型,则执行以下操作

if(([arrareasdata2 objectAtIndex:indexPath.row].length > 0)
然后在if语句中检查长度

NSString *value = (NSString*)[arrareasdata2 objectAtIndex:indexPath.row];

请在发布前阅读网站规则。请在发布前阅读网站规则。