我在我的iOS应用中收到警告。它似乎并没有影响iOS 6的性能,但是当从iOS 7 beta 2中的Flickr加载照片时,我的应用程序崩溃了,我不确定Beta是否存在问题或与此警告有关,但是无论如何,我都想摆脱警告。有什么帮助吗?
Implicit conversion from enumeration type 'enum NSJSONWritingOptions' to different enumeration type 'NSJSONReadingOptions' (aka 'enum NSJSONReadingOptions')
NSError *error;
NSDictionary *results = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONWritingPrettyPrinted error:&error];
最佳答案
很简单!只需再次阅读警告。它表示您正在传递options参数中的NSJSONWritingOptions
选项,而它需要NSJSONReadingOptions
。
更改您的代码行,如下所示:
NSDictionary *results = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:&error];
它应该可以帮助您。
关于ios - Flickr照片管理器中的JSON警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17368878/