Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7648987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:51:10+00:00 2026-05-31T10:51:10+00:00

I am developing a iPhone app running on iOS5, and am unable to set

  • 0

I am developing a iPhone app running on iOS5, and am unable to set up geofences when I call the startMonitoringForRegion:desiredAccuracy: method on click of a button.

It works fine in the simulator when I print out the regions in monitoredRegions, but when running on an actual iPhone 4, the monitoredRegions is always empty. Expectedly, the didEnterRegion: and didExitRegion: methods are not called as well.

Another puzzling fact is that on BOTH the simulator and the iPhone 4 device, the CLLocationManagerDelegate method didStartMonitoringForRegion: is never called as well.

Would appreciate some help here, thank you!

EDIT:
this is method that I call on click of a button:

-(void) queueGeofence: (CLLocationCoordinate2D)selectedBranch userCoordinate:(CLLocationCoordinate2D)userCoordinate radius: (CLLocationDegrees)radius {
geofence = [[CLRegion alloc] initCircularRegionWithCenter:selectedBranch radius:radius identifier:@"geofence"];

CLLocationAccuracy acc = kCLLocationAccuracyNearestTenMeters;

[locationManager startMonitoringForRegion:geofence desiredAccuracy:acc];
[CLLocationManager regionMonitoringEnabled];

NSLog([CLLocationManager regionMonitoringEnabled] ? @"regionMonitoringEnabled:Yes" : @"regionMonitoringEnabled:No");
NSLog([CLLocationManager regionMonitoringAvailable] ? @"regionMonitoringAvailable:Yes" : @"regionMonitoringAvailable:No");

NSLog(@"LOCATIONMANAGER monitored regions: %@", [locationManager monitoredRegions]});
}

Region monitoring is both enabled and available, but monitoredRegions is still giving me back nothing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:51:12+00:00Added an answer on May 31, 2026 at 10:51 am

    If you look in CLLocationManager.h, the comments in the header for startMonitoringForRegion:desiredAccuracy: state that

    If a region with the same identifier is already being monitored for this application, it
    will be removed from monitoring. This is done asynchronously and may not be immediately reflected in monitoredRegions.

    Therefore, you shouldn’t necessarily expect that [locationManager monitoredRegions] would include your newly added region since it is added asynchronously.

    Are you implementing the delegate method for locationManager:monitoringDidFailForRegion:withError:? Maybe that’s getting called instead of locationManager:didStartMonitoringForRegion:. Also note that a region with the same identifier as an existing region will get removed, so you might be running into some unexpected problems because you’re reusing "geofence" as your identifier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running into a crash issue while developing an iPhone app with Core Data.
developing iphone app, I have used a UIImageview and i have set an image
I'm developing an iPhone app with XCode. I want to track the running applications
I have a running JQueryMobile App that Im developing with PhoneGap for Android/IPhone, and
I'm developing an iPhone app that uses the built-in SQLite database. I'm trying to
I've been developing an iPhone app that uses a UIToolbar (in the context of
I'm developing an iPhone app and have a question about memory management. Let's say
I am developing an iPhone app that displays several views, all acessed via Tab
I'm developing an iPhone app that features a tab-bar based navigation with five tabs.
I'm developing an iPhone app that has a network component. I'm developing the app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.