• 自定义cell
    1.新建cell UITableViewCell
    2.重写initWithStyle:reuseIdentifier
    添加所有子控件,不需要设置frame 和数据 ;子控件一次性的属性设置
    3.提供两个模型 数据模型和frame模型
    4.cell 拥有一个frame模型
    5.重写frame模型的setter方法 在这个方法中设置子控件的显示数据和frame

  • Unknown type name “CGRect”,did you mean “Rect”? 原因:Xcode 6 之后创建文件 不自动导入 #import ,添加上之后就好了。


  • NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -980
    ios 9 的限制 在info。plist文件里加入NSAppTransportSecurity dictionary-》NSAllowsArbitraryLoads YES,实现任性加载

  • 由于复制了项目,添加了文件夹,修改了info.plist文件 run的时候显示The file “WeiBo” couldn’t be opened because you don’t have permission to view,build Setting 中搜索plist文件配置,发现路径是上个项目的路径,修改为拷贝后的路径,run success

  • 获取沙盒路径 将模型数据归档存储

        NSString *doc = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
    NSString *file = [doc stringByAppendingPathComponent:@"account.data"];
    [NSKeyedArchiver archiveRootObject:account toFile:file];
    

    归档时必须告诉模型对象,哪些属性需要存储和获取,模型实现代理NSCoding

/**
*  文件中解析调用
*
*  @param aDecoder <#adecoder description#="">
*
*  @return <#return value="" description#="">
*/
-(id)initWithCoder:(NSCoder *)aDecoder{
if (self = [super init]) {
self.access_token = [aDecoder decodeObjectForKey:@"access_token"];
self.uid = [aDecoder decodeInt64ForKey:@"uid"];
self.remind_in = [aDecoder decodeInt64ForKey:@"remind_in"];
self.expires_in = [aDecoder decodeInt64ForKey:@"expires_in"];
self.availbleTime = [aDecoder decodeObjectForKey:@"availbleTime"];

}
return self;
}
/**
*  存储入文件调用
*
*  @param aCoder <#acoder description#="">
*/

-(void)encodeWithCoder:(NSCoder *)aCoder{
[aCoder encodeObject:self.access_token forKey:@"access_token"];
[aCoder encodeInt64:self.uid forKey:@"uid"];
[aCoder encodeInt64:self.remind_in forKey:@"remind_in"];
[aCoder encodeInt64:self.expires_in forKey:@"expires_in"];
[aCoder encodeObject:self.availbleTime forKey:@"availbleTime"];

}
  • AFNetWorking MBProgressHUD 网络加载和加载提示框架

  • OAuth认证 获取accessToken 获取用户信息

  • UIWebView

  • SDWebImage build failed
    Use of undeclared identifier ‘_executing’;
    Use of undeclared identifier ‘_finished’;
    添加 SDWebImageDownloaderOperation类的实现中(@implementation SDWebImageDownloaderOperation{…}下面)添加@synthesize executing=_executing;@synthesize finished=_finished;



  • UIScrollView 实现新特性页面
  • 实现UIScrollView 的delegate 监听页面的滚动 显示pageControl

  • navigationitem UIBarButtonItem 的分类
  • 自定义navigationitem 的titleview UIButton
  • 自定义navigationitem 的搜索框UITextField


  • 设置代理 在事件的发起对象里创建代理,声明协议和要实现的方法

  • KVO

  • bounds 和 frame

  • 自定义UINavigationController 拦截pushviewController 隐藏tabBar

  • tableview 的cell 点击事件的响应 ,方法自动补全不注意可能掉错 didselect 和diddeseleted