I want Location based Reminder when user reaches to 开发者_如何转开发certain region
For that I have writen followin code
CLLocationManager *manager=[[CLLocationManager alloc] init];
manager.desiredAccuracy=kCLLocationAccuracyBest;
manager.delegate=self;
CLLocationCoordinate2D loc;
loc.latitude=LReminder.lat;
loc.longitude=LReminder.lon;
CLRegion *region=[[CLRegion alloc] initCircularRegionWithCenter:loc
radius:LReminder.accuracy dentifier:LReminder.title];
CLLocationAccuracy acc=1.0;
[manager startMonitoringForRegion:region desiredAccuracy:acc];
[manager startMonitoringSignificantLocationChanges];
And for the manager delegate
-(void)locationManagerCLLocationManager *)manager didEnterRegionCLRegion *)region
{
    NSLog(@"didEnterRegion for %@",region.identifier);
    UIAlertView *alr=[[UIAlertView alloc] initWithTitle:@"Reminder didEnterRegion" 
message:region.identifier delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok",nil];
    [alr show];
    [alr release];
}
-(void)locationManagerCLLocationManager *)manager didExitRegionCLRegion *)region
{
    NSLog(@"didExitRegion for %@",region.identifier);
    UIAlertView *alr=[[UIAlertView alloc] initWithTitle:@"Reminder didExitRegion" message:region.identifier delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok",nil];
    [alr show];
    [alr release];
}
Problem is when I reach to reminder location it is not calling any of the delegates' methods
please help me
Without knowing more, I can only guess, but I'm betting you're not using an iPhone 4. Region monitoring currently only works on the iPhone 4.
You should be using:
[CLLocationManager regionMonitoringEnabled]
to determine if your device can use region monitoring.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论