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

  • Home
  • SEARCH
  • 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 6058151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:34:06+00:00 2026-05-23T08:34:06+00:00

I need to call [[MKLocationManager sharedLocationManager] _applyChinaLocationShift:newLocation] in my iOS app. I believe MKLocationManager

  • 0

I need to call

[[MKLocationManager sharedLocationManager] _applyChinaLocationShift:newLocation]

in my iOS app.

I believe MKLocationManager is a private class, and there does not seem to have a MapKit/MKLocationManager.h file.

I’m not targeting App Store. It’s there any way I can use that private API?

Update at 2011-6-23

I really need the answer, or could I de-complie the iOS SDK?

100 reputation is almost all I have. Please help me.

  • 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-23T08:34:07+00:00Added an answer on May 23, 2026 at 8:34 am

    If the above answer isn’t working for you, this may be because the entire class is private (including it’s header). Here’s an alternative approach using some runtime trickery; you must be sure that the signature is correct but we can use some defensive coding to avoid a crash.

    First, unless you are calling this just once, I’d wrap up the code in a helper method:

    // in some header file, you may want to give the method a prefix too
    CLLocation *ApplyLocationManagerChinaLocationShift(CLLocation *newLocation);
    

    You can now use NSClassFromString to obtain a reference to the class and performSelector to perform the method. We can try and make sure the method exists first to be on the safe side:

    CLLocation *ApplyLocationManagerChinaLocationShift(CLLocation *newLocation)
    {
      id sharedLocationManager = [NSClassFromString(@"MKLocationManager") performSelector:@selector(sharedLocationManager)];
    
      SEL theSelector = @selector(_applyChinaLocationShift:);
    
      // this will ensure sharedLocationManager is non-nil and responds appropriately
      if (![sharedLocationManager respondsToSelector:theSelector]) {
        return nil; // fail silently - check this in the caller
      }
      return [sharedLocationManager performSelector:theSelector withObject:newLocation];
    }
    

    I haven’t run the above code but it should do the trick. If for some reason the @selector() calls do not work (I think they should), then you can replace them with NSSelectorFromString() calls instead.

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

Sidebar

Related Questions

I need to call class method in separate thread. The method has a parameter
I need to call panel.invalidate outside my form (WINform) class also I need to
I need to call the initialize method of the parent class, from inside the
I need to call a script from a controller function, but I am not
I need to call a static method of a class, but I only have
Need to call java ws from unix ksh script. Is there any possibility? Thanks.
I writing a PHP script program under Linux. In the script, I need call
Need to call a filter function on some options based on a radio selected
I need to call Ghostscript in one of our cgi to convert a PDF
I need to call a method and pass an object from my custom UITableViewClass

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.