hey all. i use CLLocationManager in my project. it works good for now. what my problem is when the user doesn't allow CLLocationManager then i place a UILabel on the view. but it is seen every time when the application is launched. i want to it will be seen only once when the user doesn't allow the CLLocationManager. how i can fix my code ? here how it looks.
Code:
-(void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
{
if (status == kCLAuthorizationStatusDenied)
{
UILabel *lblWarning=[[UILabel alloc] initWithFrame:self.lblCurrenTime.frame];
[self.middleView addSubview:lblWarning];
lblWarning.center=self.middleView.center;
lblWarning.text=@"Select a Name";
lblWarning.font=[UIFont fontWithName:@"Helvetica-Bold" size:17];
lblWarning.backgroundColor=[UIColor clearColor];
lblWarning.textColor=[UIColor whiteColor];
lblWarning.textAlignment=NSTextAlignmentCenter;
lblWarning.tag=999;
}
}