Skip to content
Browse files

Ensure only return UITableViewCell if that cell is loaded into the Ta…

…bleView
  • Loading branch information...
1 parent 76a855b commit faee75d3f2c59aeb9c1cee2b38f2dd7cfda02a03 Eric + Chaise committed Jul 2, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 Additions/UIAccessibilityElement-KIFAdditions.m
View
7 Additions/UIAccessibilityElement-KIFAdditions.m
@@ -22,11 +22,14 @@ + (UIView *)viewContainingAccessibilityElement:(UIAccessibilityElement *)element
element = [element accessibilityContainer];
if([element isKindOfClass:NSClassFromString(@"UITableViewCellAccessibilityElement")]){
- element = [element performSelector:@selector(tableViewCell)];
+ UITableViewCell *cell = [element performSelector:@selector(tableViewCell)];
+
+ //If the cell has a superview (has been loaded into the table) then the cell is the view we are after
+ if(cell.superview)
+ element = (id)cell;
}
}
return (UIView *)element;
}
-
@end

0 comments on commit faee75d

Please sign in to comment.
Something went wrong with that request. Please try again.