- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID= @"catogoryCell";
CustomCatogory *cell = (CustomCatogory *)[tableView dequeueReusableCellWithIdentifier:cellID];
if(cell==nil)
{
NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCatogory" owner:nil options:nil];
for(id currentObject in nibObjects)
{
if([currentObject isKindOfClass: [CustomCatogory class]])
{
cell = (CustomCatogory *)currentObject;
}
}
}
cell.img1.image=[UIImage imageNamed:@"Tweet1.jpg"];
cell.title1.text = [categoryList objectAtIndex:indexPath.section] ;
return cell;
}
static NSString *cellID= @"catogoryCell";
CustomCatogory *cell = (CustomCatogory *)[tableView dequeueReusableCellWithIdentifier:cellID];
if(cell==nil)
{
NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCatogory" owner:nil options:nil];
for(id currentObject in nibObjects)
{
if([currentObject isKindOfClass: [CustomCatogory class]])
{
cell = (CustomCatogory *)currentObject;
}
}
}
cell.img1.image=[UIImage imageNamed:@"Tweet1.jpg"];
cell.title1.text = [categoryList objectAtIndex:indexPath.section] ;
return cell;
}
Very nice t o lern it !Keep it up..
ReplyDelete