Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 以编程方式创建时是否本地化NSPredicateEditorRowTemplate?_Xcode_Macos_Localization_Nspredicateeditor - Fatal编程技术网

Xcode 以编程方式创建时是否本地化NSPredicateEditorRowTemplate?

Xcode 以编程方式创建时是否本地化NSPredicateEditorRowTemplate?,xcode,macos,localization,nspredicateeditor,Xcode,Macos,Localization,Nspredicateeditor,我在PredicateEditor中的一个表达式是一个月,我想表示为一个常量值为1的弹出按钮。。十二, 这是我的代码: func predicateMonth() -> NSPredicateEditorRowTemplate{ var monthList = [NSExpression]() for i:NSInteger in 1...12 { monthList.append(NSExpression(forConsta

我在PredicateEditor中的一个表达式是一个月,我想表示为一个常量值为1的弹出按钮。。十二,

这是我的代码:

    func predicateMonth() -> NSPredicateEditorRowTemplate{
        var monthList = [NSExpression]()
        for i:NSInteger in 1...12 {
            monthList.append(NSExpression(forConstantValue:i))
        }
        
        let leftExp = NSExpression(forKeyPath:"monthP")
        
        let monthTemplate = NSPredicateEditorRowTemplate (
            leftExpressions: [leftExp],
            rightExpressions: monthList,
            modifier: NSComparisonPredicate.Modifier(rawValue: 0)! ,
            operators: [NSNumber(value:4)],
            options: 0)

        return monthTemplate
    }
在我的代码中,在哪里为monthP设置本地化字符串?
它应该在编辑器中显示“月”,而不是“月”

这是否回答了您的问题?