对于 ios 项目中 warning 黄色警告的去除


zipArchive 包里面有两个已经被弃用的方法:

NSDictionary* attr = [[NSFileManager defaultManager] fileAttributesAtPath:file traverseLink:YES]; 
warning:
'fileAttributesAtPath:traverseLink:' is deprecated


解决:改为

NSError* error;

NSDictionary* attr = [[NSFileManager defaultManager] attributesOfItemAtPath:file error:&error];

NSString * strPath = [NSString  stringWithCString:filename];

warning:stringWithCString is deprecated

解决:改为

NSString * strPath = [NSString stringWithCString:filename encoding:NSASCIIStringEncoding];

2.JSONKit 的几个错误

   warning:   Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()

解决方案: replacing    object->isa   with   object_getClass(object)

You will also need to replace   keyObject->isa   with   object_getClass(keyObject)    and   (id)keys[idx]->isa  with  object_getClass((id)keys[idx])

jsonkit 还有 %lu与%u的提示 replace就可以

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM