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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:52:42+00:00 2026-06-13T00:52:42+00:00

I have a little issue with Xcode and was wondering if anybody has this

  • 0

I have a little issue with Xcode and was wondering if anybody has this solved in a clever way?

Scenario:

  • Two developers working on an iOS app.
  • Single Xcode project hosted on GitHub.
  • I have three configurations: Debug, TestFlight and Release.
  • For at least the Release versions I want the hostname of our web services API to be compiled into the app.

I have code like this in out API wrapper:

#ifdef CONFIGURATION_Debug
   static NSString * const kAPIBaseURLString = @"http://10.10.10.41:8080/api";
#elif CONFIGURATION_TestFlight
   static NSString *const kAPIBaseURLString = @"http://9.9.9.9.eu-west1.compute.amazonaws.com:8080/api";
#elif CONFIGURATION_Release
   static NSString * const kAPIBaseURLString = @"http://some.production.server";
#else
   static NSString * const kAPIBaseURLString = @"http://error-crazy-configuration-must-be-set-in-xcode";
#endif

This all works great, however, there is a Git battle between the developers about the DEBUG string. Each points to our own dev lab and the file is constantly being checked in as either one address or the next. Its a pain.

I don’t want to have git “assume-nochanges” as there is important code changed regularly in this class.

I have thought about passing in the hostname as an arg, but that also causes changes to the project structure that git sees.

Any brainwaves on how to allow us to set the hostname without out getting Xcode or git in a twist?

  • 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-13T00:52:44+00:00Added an answer on June 13, 2026 at 12:52 am

    Use schemes in Xcode.
    For the Run configuration, add an environment variable:

    APIBASEURLSTRING http://10.10.10.41:8080/api
    

    For the Release configuration, add the same environment variable:

    APIBASEURLSTRING http://some.production.server
    

    …and etcetera etcetera for the rest of your build configurations.

    Under Manage Schemes, ensure the Shared checkbox is unchecked.

    In your code, access the environment variable using:

    baseUrlString = [[[NSProcessInfo processInfo] environment] objectForKey:@"APIBASEURLSTRING"];
    

    As long as you’re not using shared schemes, all users can set their own environment variables/custom endpoints.

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

Sidebar

Related Questions

Hey most of my issue has been solved but i have little problem This
I have a little issue, I'll try to explain this in detail. Over my
I have this tiny little issue with the datagrid. In my grid I have
Have a little design issue after having upgraded to iOS 5 and Xcode 4.2
I have a little issue with Java UTF-8 converting.I have this Objective C code
I have a little issue with my hibernate logging configuration. In our application, we
I have a little issue with my CSS: I have a hyperlink element which
I have a little issue concerning an animation-effect which loads a certain div into
Hey guys I have a little issue here. I have a panel where I
im having a little issue here. I have MediaElement.js set on my project. It

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.