for (UIView *subview in [mainTableView subviews]) { if ([subview isKindOfClass:NSClassFromString(@"UITableViewIndex")]) { [subview performSelector:@selector(setBackgroundColor:) withObject:[UIColor clearColor]]; // [subview setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"indexbg.png"]]]; } if([subview respondsToSelector:@selector(setIndexColor:)]) { [subview performSelector:@selector(setIndexColor:) withObject:[UIColor redColor]]; } if([subview respondsToSelector:@selector(setIndexBackgroundColor:)]) { // [subview performSelector:@selector(setIndexBackgroundColor:) withObject:[UIColor greenColor]]; } }