I'm new to objective-c and ios development and looking for best practice. I want to have different constants BASE_URL
which is dependant on DEBUG and PRODUCTION environment..
I want it to look like, e.g. Constants.m:
#import "Constants.h"
static NSString *BASE_URL = @"http://localhost:3000";
NSString * const API_URL = [BASE_URL stringByAppendingString:@"/api"];
and .pch file:
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "Constants.h"
#endif
But compiler is saying I'm wrong here - NSString * const API_URL = [BASE_URL stringByAppendingString:@"/api"];
Initializer element is not a compile-time constant