以下代码在 IOS 5 中运行良好,但现在handleTapGesture
在 IOS 6 中甚至没有被调用。发生了什么变化?
- (id)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)];
[self addGestureRecognizer:tap];
}
return self;
}
- (void)handleTapGesture:(UITapGestureRecognizer *)recognizer
{
MessageNib *cell = self;
MessageView *view = (MessageView *)[[[NSBundle mainBundle] loadNibNamed:@"MessageView" owner:self options:nil] objectAtIndex:0];
view.message = cell.message;
[[NSNotificationCenter defaultCenter] postNotificationName:NEW_SUB_PAGE object:view];
}