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"];
}#acoder>#return>#adecoder>
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;