iOS 加载xib cell

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

    static NSString *cellIndentifier = @"AccountDetailTableViewCell";//这里的cellID就是cellxib对应的名称

    AccountDetailTableViewCell *celll = (AccountDetailTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIndentifier];

    if(nil == celll) {

        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:cellIndentifier owner:self options:nil];

        celll = [nib objectAtIndex:0];

    }

    return celll;

}

你可能感兴趣的:(xib)