0

This code is not saving "Add notes" into placeholderText, but instead it is saving just "blog_add_notes". I also tried to cast it to String but it doesn't work.

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initValues];

    NSString *placeholderText = NSLocalizedString(@"blog_add_notes", @"");
    _txtDescription.placeholder = placeholderText;
    //more code
}

But when I print po NSLocalizedString(@"blog_add_notes", @"") it prints in fact "Add notes"

What I'm doing wrong?

Jalil
  • 1,167
  • 11
  • 34
  • 1
    Does seem curious, can you edit your question and add some more details? E.g. where are your two lines of code, what does the debugger say is in `placeholderText`, what is `_txtDescription`, if you right-click `NSLocalizedString` in your first line can you "Jump to Definition" and if so what does it show, etc. With this extra information somebody will probably help you. – CRD Dec 05 '19 at 22:22
  • In "Jump to Definition" I have the ios13 code. placeholderText says its `blog_add_notes` and `_txtDescription` is a TextView – Jalil Dec 05 '19 at 22:34
  • What do you mean by "the ios13 code"? `NSLocalizedString` is (or was if its changed in ios 13) a macro defined in `NSBundle.h`. Can you reproduce the error in a new project which does nothing but the `NSLocalizedString` call in `viewDidLoad` (just use a breakpoint to examine the return value). – CRD Dec 06 '19 at 02:42

0 Answers0