与整数转换不兼容的指针将'void*'发送到'NSJSONReadingOptions'类型的参数

Bra*_*don 3 iphone xcode objective-c ios

我收到一个奇怪的编译器警告.它说:

Incompatible pointer to integer conversion sending 'void *' to parameter of type 
'NSJSONReadingOptions' (aka 'enum NSJSONReadingOptions') 
Run Code Online (Sandbox Code Playgroud)

这是它的块:

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;

    //Incompatible pointer to integer conversion sending 'void *' to parameter of type 
    'NSJSONReadingOptions' (aka 'enum NSJSONReadingOptions')

    news = [NSJSONSerialization JSONObjectWithData:data options:nil error:nil];
    [mainTableView reloadData];
}
Run Code Online (Sandbox Code Playgroud)

任何想法如何解决这一问题?谢谢!

Mar*_*n R 26

只需替换options:niloptions:0.

nil最终定义为((void*)0)并具有指针类型,但NSJSONReadingOptions(作为枚举)是整数类型.