(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
dictionary = [QuestionMutableArray objectAtIndex:0];
static NSString *CellIdentifier = @"BeginingCell";
BeginingCell *cell=(BeginingCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects=[[NSBundle mainBundle] loadNibNamed:@"BeginingCell" owner:self options:nil ]; for(id CurrentObject in topLevelObjects) { if ([CurrentObject isKindOfClass:[BeginingCell class]]) { cell=(BeginingCell *) CurrentObject; break; } }
}
// Configure the cell.
if(indexPath.row==0) {
cell.SectionTitle.text=[dictionary objectForKey:@"question"]; cell.Option1.text=[dictionary objectForKey:@"option1"]; cell.Option2.text=[dictionary objectForKey:@"option2"]; cell.Option3.text=[dictionary objectForKey:@"option3"]; cell.Option4.text=[dictionary objectForKey:@"option4"]; UIImage *imgDef=[UIImage imageNamed:@"man_kirstie_alley.jpg"]; [cell.myImageView setImage:imgDef]; [MyTestArray release]; [cell.button1 setTitle:@"A." forState:UIControlStateNormal]; [cell.button2 setTitle:@"B." forState:UIControlStateNormal]; [cell.button3 setTitle:@"C." forState:UIControlStateNormal]; [cell.button4 setTitle:@"D." forState:UIControlStateNormal];
}
return cell;
}