iphone - warning: local declaration of 'mapView' hides instance variable -


please, can explain , me how fix warning?? thx in advance.

-(void)mapview:(mkmapview *)mapview regionwillchangeanimated:(bool)animated {          mapregion=mapview.region; //first warning     }     -(void)mapview:(mkmapview *)mapview regiondidchangeanimated:(bool)animated  {          newregion=mapview.region; //second warning         if(mapregion.span.latitudedelta>newregion.span.latitudedelta||mapregion.span.longitudedelta>newregion.span.longitudedelta)             shouldadjustzoom=no;      } 

you have instance variable name mapview already.

you can change local name else. example this:

-(void)mapview:(mkmapview *)amapview regionwillchangeanimated:(bool)animated {       mapregion=amapview.region; //first warning }  -(void)mapview:(mkmapview *)amapview regiondidchangeanimated:(bool)animated  {     newregion=amapview.region; //second warning     if(mapregion.span.latitudedelta>newregion.span.latitudedelta||mapregion.span.longitudedelta>newregion.span.longitudedelta)             shouldadjustzoom=no; } 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -