新浪微博客户端(29)-格式化微博来源显示

 

DJStatus.m

// 更新来源显示
- (void)setSource:(NSString *)source {

    NSRange range;
    range.location = [source rangeOfString:@">"].location + 1;
    range.length = [source rangeOfString:@"<" options:NSBackwardsSearch].location - range.location;
    _source = [NSString stringWithFormat:@"来自%@",[source substringWithRange:range]];
    
}

 

最终效果:

 

posted @ 2016-11-21 22:14  夜行过客  阅读(315)  评论(0编辑  收藏  举报