0
我正在使用JSON填充帶標記的mapView。NSJSONSerialization編譯器警告
在方法-(void)connectionDidFinishLoading:(NSURLConnection *)connection
編譯器表示警告:
Incompatible pointer to integer conversion sending 'void *' to parameter of type 'NSJSONReadingOptions' (aka 'enum NSJSONReadingOptions')
在線路
categorias_first = [NSJSONSerialization JSONObjectWithData:data_for_first_connection options:nil error:nil];
categorias_second = [NSJSONSerialization JSONObjectWithData:data_for_second_connection options:nil error:nil];
categorias_third = [NSJSONSerialization JSONObjectWithData:data_for_third_connection options:nil error:nil];
這是整個方法的代碼:
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
//if data received network indicator not visible
[UIApplication sharedApplication].networkActivityIndicatorVisible=NO;
if(connection==first_connection) {
categorias_first = [NSJSONSerialization JSONObjectWithData:data_for_first_connection options:nil error:nil];
}
else if(connection==second_connection){
categorias_second = [NSJSONSerialization JSONObjectWithData:data_for_second_connection options:nil error:nil];
}
else if(connection==third_connection){
categorias_third = [NSJSONSerialization JSONObjectWithData:data_for_third_connection options:nil error:nil];
}
}
歡迎任何幫助以避免警告。
通'0',不'nil'爲'options'參數。 – rmaddy