0

I have a image view(tapping on which i get a popover) inside a cell associated in table views. Log element tree captures the static text 'Picture' but it doesn't show associated image view with it.

My flow is like tables -> cells( have around 4 cells which are static texts)

These cells in turn have textfields attached with them. cell1-> textfields1 cell2-> textfields2 cell3-> textfields3 cell4-> has just an image.

How do I access this Image?

  var imageId = table[0].cells()[4];

  imageId.images();

Dis not return anything.

Thejaswi
  • 3
  • 3

1 Answers1

0

i think u can configure ur cell like this:

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];

}

    CGRect Frame4 = CGRectMake(10.0, 30.0, 50.0, 40.0);
    UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
    button.frame = Frame4;
    [button setTitle:@"Click" forState:UIControlStateNormal];
    button.backgroundColor = [UIColor grayColor];
    [button addTarget:self
           action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
    [cell.contentView addSubview:button];




return cell;

}

and then add button action event :

  • (IBAction)buttonPressed:(UIButton *)sender{

    // in sender u can get which button is pressed //do something }

please replace " UIButtonTypeDetailDisclosure " for ur desire image Button

MH babu
  • 1
  • 1