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 8539847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:27:51+00:00 2026-06-11T11:27:51+00:00

i am implementing an iOS application, and i want to set the user location

  • 0

i am implementing an iOS application, and i want to set the user location programmatically. i have tried mapView.

        mapView.userLocation.location.coordinate=CLLocationCoordinate2DMake(latFloat, longFloat);

it tells that this is assigned to readonly property.

so how to assign the user location programmatically? aiming to show the blue point at a custom location.

  • 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-06-11T11:27:52+00:00Added an answer on June 11, 2026 at 11:27 am

    As far as I know you can’t. That property is for the user location, not an arbitrary point. You should use MKAnnotation and it’s associated classes for such a thing. If you wanted to do a kind of point with a pulsing circle similar to the user location you may find an custom MKOverlay more suitable. Be warned though multiple MKOverlays will crash your application in which case you want to draw the many things in one MKOverlayView using an MKOverlayPathView.

    ** As an aside, for testing in the simulator you can pass in an arbitrary list of points to the simulator that it will feed into the app as the userlocation. This is solely for testing various map related code though and won’t actually help or work in ‘the real world’**

    Something like, assuming ‘annotations’ is an NSMutableArray containing your annotations.

    -(MKAnnotationView *)mapView:(MKMapView *)mV 
        viewForAnnotation:(id <MKAnnotation>)annotation {
    
      MKPinAnnotationView *pinView = nil;
      MKPinAnnotationColor pinColor = MKPinAnnotationColorPurple;
      if([annotations lastObject] == annotation)  
      {
        pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"LastLocationIdentifier"];
        pinColor = MKPinAnnotationColorGreen;
      }
      else
      {
        pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"PreviousLocationIdentifier"];
      }
    
      pinView.pinColor = pinColor;
    
      return pinView;
    }
    

    I’m not currently in a position to test this but will do later.

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

Sidebar

Related Questions

I am implementing an iOS application, and I want to draw a polyline between
I am implementing a simple iOS solitaire game that allows the user to drag
I have a question friends.Please help me guys. I am implementing an ios app
I'm implementing an epub reader in iOS platform. I have paginated the HTML files
Are there any examples/recommended approaches for implementing a location picker (for want of a
I am new to iOS development and I have started implementing the Facebook SDK
I'm a new in iOS, and I have trouble in implementing @protocol so sorry
I am newbie working on iOS application for iPad. I have successfully implemented a
I am implementing an iphone application (iOS 4.2) from where I would like to
I am developing an application for iOS 4.x devices. I am implementing a communication

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.