-(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;
}
ここで mycustomcell は、tableview のセルではなく Custome セルです...これがうまくいくことを願っています.. mycustomecell という名前の新しい custome セルを .h 、.m および .xib で作成します。