对于 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就可以

 

posted @ 2012-11-25 20:48  SuperHappy  阅读(4688)  评论(0编辑  收藏  举报