昨天在做iOS6的兼容时出现了这个问题,只要设置下手机就可以消除这个Log了。今天在次遇到了这个问题,设置后也不起作用,还有其它的错误提示:"-[NSConcreteData initWithBase64EncodedString:options:]: unrecognized selector sent to instance ",在次根据这个提示在代码中找到了initWithBase64EncodedString:options这个,看了下api 这个方法是在iOS7才出现的,在iOS6中是不起作用的,最后修改了下代码就没有这个提示了。代码如下:
//这里要做ios6的兼容
NSData *certData;
if ([NSData instancesRespondToSelector:@selector(initWithBase64EncodedString:options:)]) {
certData = [[NSData alloc] initWithBase64EncodedString:certString options:0];
}else{
certData = [[NSData alloc] initWithBase64Encoding:certString];
}
这种问题都是iOS缓存的问题,如果光是提示“ADDRESPONSE - ADDING TO MEMORY ONLY:”的话可以不用处理。如果还有其它的提示就要来相应处理下了。
参考:http://www.itstrike.cn/question/297e76c6-2d45-4b5b-9df3-1e4f7d200d88.htmlhttp://stackoverflow.com/questions/21392190/base64encodedstringwithoptions-crashing-on-sentest
http://blog.csdn.net/ayuapp/article/details/11989195
http://stackoverflow.com/questions/11300044/on-ios-where-is-the-nsurlcache-cache-stored-if-diskpathnil?lq=1