Skip to content

Instantly share code, notes, and snippets.

@MariusCiocanel
Created September 18, 2012 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MariusCiocanel/3742253 to your computer and use it in GitHub Desktop.
Save MariusCiocanel/3742253 to your computer and use it in GitHub Desktop.
You'd have to add the Reachability code to your project http://developer.apple.com/library/ios/#samplecode/Reachability/Listings/Classes_Reachability_m.html#//apple_ref/doc/uid/DTS40007324-Classes_Reachability_m-DontLinkElementID_6
___________
#import "Reachability.h"
+(NSString*)serverBaseURL {
if ([Reachability reachabilityWithHostName:@"macbook.local"].currentReachabilityStatus != NotReachable) {
return @"macbook.local";
}
if ([Reachability reachabilityWithHostName:@"macdesktop.local"].currentReachabilityStatus != NotReachable) {
return @"macdesktop.local";
}
return @"productionURL.com";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment