Skip to content

Define a marco or function,meet a error:Argument is not a literal string #211

@HKevin1993

Description

@HKevin1993

Expected Behavior

no error

Actual Behavior

bartycrouch work,but throw a error with “bad entry in file /Users/xxx/Desktop/project_xxx/project_xxx/Macros.swift (line = 11): Argument is not a literal string.”

Steps to Reproduce the Problem

  1. define a function:
    func kkLocalizedString(_ key: String, comment: String) -> String {
    NSLocalizedString(key, tableName: "kkLocalizable", bundle: Bundle.main, value: "", comment: comment)
    }
  2. build project
  3. error

Specifications

  • Version: 4.3.1
  • Platform: iOS
  • IDE Version:Xcode 12.2

My point

bartycrouch script run before compile sources, then the "key" of NSLocalizedString is not string

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions