title: Objective-C #define directive demonized for String constants
body: <p>I've reading in several post and in Apple's code guidelines that in Objective-C String constants should be defined as extern <code>NSString *const MY_CONSTANT;</code> and that the #define directive should be avoided. Why is that? I know that <code>#define</code> is run at precompile time but all string will share the same memory address. The only advantage I read was that if the constant must be updated or changed you don't have to recompile your entire project. So that i s the reason why #define should be avoided?</p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE:</strong> In this case is good to use a #define or there is a better approach?</p>
  
  <pre><code>/* Constants Definition */
  #define SERVER_URL @"http://subdomain.domain.edu.ar/Folder/"
  NSString *const ServerURL = SERVER_URL;
  NSString *const LoginURL = SERVER_URL@"welcome.asp";
  NSString *const CommandURL = SERVER_URL@"com.asp";
  </code></pre>