-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [arrData count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"SimpleTableCell";
mycustomcell *cell = (mycustomcell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"mycustomcell" owner:self options:nil];
cell = [nib objectAtIndex:0];
NSLog(@"NIB = %@",nib);
NSLog(@"Cell = %@",cell);
}
cell.lblName.text = [[arrData objectAtIndex:indexPath.row] objectForKey:@"Name"];
cell.lblId.text = [[arrData objectAtIndex:indexPath.row] objectForKey:@"Id"];
cell.lblGender.text = [[arrData objectAtIndex:indexPath.row] objectForKey:@"Gender"];
cell.lblAddress.text = [[arrData objectAtIndex:indexPath.row] objectForKey:@"Address"];
cell.lblPhone.text = [[arrData objectAtIndex:indexPath.row] objectForKey:@"Phone"];
cell.lblEmail.text = [[arrData objectAtIndex:indexPath.row] objectForKey:@"Email"];
NSLog(@"tbl %@",cell.lblName.text);
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 200;
}
는 손님 여러분 전지하지의 tableview의 세포입니다 ... 나는이 당신을 위해 일하는 희망 .. 당신은해야
당신은 셀이 전무 있는지 확인하고 펜촉을로드하는 데 더 이상 필요하지 않습니다, 데이터를 다시로드 :)! –
ohh ok thanx 나는 이런 것들을 안다. :) –
Raphael이 틀렸다.'dequeueReusableCellWithIdentifier :'는 아직 캐시되지 않은 셀에 대해 nil을 리턴한다. 'dequeueReusableCellWithIdentifier : forIndexPath :'는 캐시되지 않은 셀에 대해 새로운 셀 객체를 생성합니다. – vikingosegundo