问题描述
我在项目中设置TTTAttributedLabel时遇到问题。
I'm having problems setting up the TTTAttributedLabel within my project.
我在头文件中设置了协议委托
I have set the protocol delegate in my header file
@interface TwitterFeedControlleriPad : UIViewController <TTTAttributedLabelDelegate, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateWaterfallLayout>
我已将ViewController设置为它(不是零,我已经检查过了。)
I have set the ViewController to it (is not nil, I checked already).
cell.tweetLabel.delegate = self;
它显示标签中的所有链接,但是当我点击它们时它不会调用该函数。 / p>
It's showing all the links right in the label but when I tap them it's not calling the function.
- (void)attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url
我之前已经成功使用它,它的代码完全一样!这让我发疯了!
I've already used it before with success and it's exactly the same code!! It's driving me crazy!
推荐答案
解决了!问题是CollectionViewCell中的User Interaction Enabled复选框......它被禁用了!我花了4个小时才想出来!不管怎样,谢谢你!
Solved! The problem was the "User Interaction Enabled" Checkbox in the CollectionViewCell... It was disabled! it took me 4 hours to figured it out!! Thank you anyway!
这篇关于iOS TTTAttributedLabel委托didSelectLinkWithURL未被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!