對於 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