Xcode 以编程方式创建时是否本地化NSPredicateEditorRowTemplate?
我在PredicateEditor中的一个表达式是一个月,我想表示为一个常量值为1的弹出按钮。。十二, 这是我的代码: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
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设置本地化字符串?
它应该在编辑器中显示“月”,而不是“月”这是否回答了您的问题?