给UIView添加一个点击事件 代码:

header.userInteractionEnabled = YES;

        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(getInfo:)];

        [header addGestureRecognizer:tap];//添加view的点击事件

        [tap release];