我点击索引的时候想要在中间显示这样一个提示。我就找到//点击右侧索引表项时调用
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
    self.slideShow.text=title;
    self.slideShow.hidden=NO;
    
    //    [self performSelector:@selector(hideSlideShow) withObject:nil afterDelay:2.0];
    return index;
}
这个方法相应 索引的点击 。
我想要的是  点击索引的时候显示这个提示,手指离开,隐藏掉提示应该怎么写。我用子线程睡眠两秒 自动隐藏 ,效果不太好

解决方案 »

  1.   

    - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
        self.slideShow.text=title;
        self.slideShow.hidden=NO;
        self.slideShow.alpha=1.0f;
        [self.timer invalidate];
        self.timer = [NSTimer scheduledTimerWithTimeInterval:0.03 target:self selector:@selector(hideSlideShow) userInfo:nil repeats:YES];    return index;
    }-(void)hideSlideShow{
        self.slideShow.alpha-=0.05;
        if (self.slideShow.alpha<=0.01) {
            self.slideShow.alpha=0;
            self.slideShow.hidden=YES;
            [self.timer invalidate];
            NSLog(@"time invalidated");
        }
    }