我用这个https://github.com/SebastienThiebaud/STTweetLabel
但我正在尝试将其添加到 UITableViewCell 如下
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
STTweetLabel *_tweetLabel = [[STTweetLabel alloc] initWithFrame:CGRectMake(20.0, 60.0, 280.0, 230.0)];
[_tweetLabel setFont:[UIFont fontWithName:@"HelveticaNeue" size:17.0]];
[_tweetLabel setTextColor:[UIColor blackColor]];
STLinkCallbackBlock callbackBlock = ^(STLinkActionType actionType, NSString *link) {
SString *displayString = NULL;
switch (actionType) {
case STLinkActionTypeAccount:
displayString = [NSString stringWithFormat:@"Twitter account:\n%@", link];
break;
case STLinkActionTypeHashtag:
displayString = [NSString stringWithFormat:@"Twitter hashtag:\n%@", link];
break;
case STLinkActionTypeWebsite:
displayString = [NSString stringWithFormat:@"Website:\n%@", link];
break;
}
NSLog(@"%@",displayString);
};
[_tweetLabel setCallbackBlock:callbackBlock];
[_tweetLabel setText:@"http://www.google.com"];
[cell addSubview:_tweetLabel];
return cell;
}
但错误是:
-[__NSArrayM set]: unrecognized selector sent to instance 0x750b160
2013-04-03 15:36:36.425 Shahona Fashion[18426:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM set]: unrecognized selector sent to instance 0x750b160'
所以我的问题是,是否可以添加 intro tableView 单元格,或者有什么方法可以以这种方式去除网址?
提前致谢 ..