add a UITapGestureRecognizer to a UILabel inside a table view cell?

Question:

sending UILabel __strong to parameter of incompatible type id<UIGestureRecognizerDelegate>   

Answer:

    _singleTap =[[UITapGestureRecognizeralloc]initWithTarget:self action:@selector(handleSingleTap)];

    [_singleTapsetNumberOfTapsRequired:1];

    _messageLabel.userInteractionEnabled = YES;

    [_messageLabeladdGestureRecognizer:_singleTap];

– (void)handleSingleTap {

    CVLastActionItem *lastActionItem = [[_streamItemobject] actionItem];

    if ([lastActionItem.sparctype isEqualToString:@”content”] && [lastActionItem.sparcsubtype isEqualToString:@”comment”]) {

        [[[lastActionItem.targetobjectAtIndex:0] objectForKey:@”record”] objectForKey:@”key”];

        UIViewController* vc = [[IPhoneMVChatViewControlleralloc] initWithKey:[[[lastActionItem.targetobjectAtIndex:0] objectForKey:@”record”] objectForKey:@”key”]];

        [vc pushToStack];

    } else {

        IPhoneMVProfileViewController* pVC = [[IPhoneMVProfileViewControlleralloc] initWithKey:[[_streamItemobject] key]];

        [pVC pushToStack];

    }

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s