1:UITableViewCell drawInRect 在iOS7中失败
解决办法,把Cell里的布局移到新建的View里面,在View里面实现DrawInRect,然后在Cell里面加载View,代码如下:
@implementation CustomTableViewCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { [self.contentView addSubview:[[CustomContentView alloc]initWithFrame:self.contentView.bounds]]; } return self; } @end
@implementation CustomContentView - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor clearColor]; } return self; } - (void)drawRect:(CGRect)rect { NSDictionary * attributes = @{ NSFontAttributeName : [UIFont fontWithName:@"Helvetica-bold" size:12], NSForegroundColorAttributeName : [UIColor blackColor] }; [@"I <3 iOS 7" drawInRect:rect withAttributes:attributes]; } @end
2:YTKNetwork的内容
YTKNetwork 是猿题库 iOS 研发团队基于 AFNetworking 封装的 iOS 网络库,其实现了一套 High Level 的 API,提供了更高层次的网络访问抽象。
YTKNetwork 使用基础教程
https://github.com/yuantiku/YTKNetwork/blob/master/BasicGuide.md
YTKNetwork 使用高级教程
https://github.com/yuantiku/YTKNetwork/blob/master/ProGuide.md
原文:http://www.cnblogs.com/wujy/p/5089821.html