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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:05:44+00:00 2026-06-10T11:05:44+00:00

In my constant file, I have included the below line NSString * ALERT_OK =

  • 0

In my constant file, I have included the below line

NSString * ALERT_OK = NSLocalizedString(@"Ok",@"Ok");

After this, when I tried to compile I am receiving the below error

Initialiser element is not a compile time constant

How can I debug this?

  • 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-10T11:05:45+00:00Added an answer on June 10, 2026 at 11:05 am

    The problem is that NSLocalizedString is a function which returns different values, depending on the language. It is not a constant which can be figured out until the system is running.

    Instead, use:

     #define ALERT_OK NSLocalizedString(@"Ok",@"Ok");
    

    And it will now simply replace ALERT_OK with the function and you will be fine. (Note that you should be using some kind of prefix to all global values like this so that you don’t accidentally create something with the same name being used somewhere else.)

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

Sidebar

Related Questions

I have a file that defines constant variables, like this: define_vars.php <? define(something,value); define(something1,value);
In the included ZenLib header file I have this define configuration //Char types #if
I have a multi-target iPhone app which currently includes a header file with constant
For the example.l lex file I get the error below. If I comment out
I have many SWF file those I have included in my web page using
Is there any explanation of this strange behavior of defined constant? I have 1
I have an assembly file ( asm.S ) which needs a constant #define 'd
I have a question about an error I'm getting when trying to compile a
i have created below function in a file info.php to debug variable & data
I have the following code: http://scrp.at/FB # Error: # bin/rpg:5:in `<main>': uninitialized constant RubyPasswordGenerator::Korben

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.