1

(Newbie alert)

I'm having trouble initializing a constant static string in objective-C:

Basically what I want to do is create a constant string from a NSLocalizedStringWithDefaultValue(...)

Any ideas?

1
  • What is your definition of a constant string? Do you mean a const char*, an @"String" or a non-mutable NSString` ? Commented Feb 1, 2010 at 23:36

1 Answer 1

1

Declare a static string in one of your implementation files. In either the class's initialize method or another appropriate setup point (depending on the exact circumstances — the sharedInstance method would be a good place in a singleton, for example), assign the localized string to the variable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.