Ios 带QuickDialog和JSON的SecureTextEntry?
我正在尝试通过JSON运行一个示例。我目前有:Ios 带QuickDialog和JSON的SecureTextEntry?,ios,ios5,quickdialog,Ios,Ios5,Quickdialog,我正在尝试通过JSON运行一个示例。我目前有: { "grouped": true, "title": "Hello World", "controllerName": "MySampleController", "sections": [ { "title":"Question:"
{
"grouped": true,
"title": "Hello World",
"controllerName": "MySampleController",
"sections":
[
{ "title":"Question:", "elements":
[
{ "type":"QLabelElement", "title":"Hello", "value":"world!"},
{ "type":"QEntryElement", "key":"login", "bind":"textValue:username", "title":"Login"},
{ "type":"QEntryElement", "key":"password", "bind":"textValue:password", "title":"Password"}
]
}
]
}
其中显示标签、用户名和密码输入。我想确保密码输入的安全性,但我一直不知道如何通过JSON做到这一点
我已尝试添加以下元素:
“secureTextEntry”:“是”
但我得到一个例外:
[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key secureTextInput.'
*** First throw call stack:
[setValue:forUndefinedKey:]:该类不符合密钥secureTextInput的密钥值编码。”
***第一次抛出调用堆栈:
关于如何通过QuickDialog的JSON实现使其正常工作,有什么建议吗?我由另一名StackOverflow成员提交此答案: UITextField的某些属性不符合KVC
在这个问题上,有另一个人使用UITextField来允许一种变通方法。也许这不是像我现在使用的那样使用代码的真正方式。但是你可以修改
qentrylement.h
和qentrylement.m
根据您的要求提供文件
删除此self.secureTextEntry=NO
;qentrylement.m文件中-(qentrylement*)init
中的行
我修改了entry元素文件并获得了securetext条目
查看我修改的方法,也许这可以帮助您:
- (QEntryElement *)initWithTitle:(NSString *)title Value:(NSString *)value Placeholder:(NSString *)placeholder andSecureTextEntry:(BOOL)_secured{
self = [self init];
if (self) {
_title = title;
_textValue = value;
_placeholder = placeholder;
self.secureTextEntry=_secured;
}
return self;
}
在qentrylement.h和m文件中。您好,控制台引用的类名是否与密钥SecureTextentry不兼容我很感激您的回答,但我真的想看看QuickDialog框架中是否有一种现有的方法来运行它。他们有json加载例程,所以我假设我忽略了正确设置属性的方法。你有权访问qentrylement的.m文件吗?但这样每个qentrylement都会变得安全吗?是的。。这是真的。如果您可以在这里设置,那么为什么不在文件之外呢?请参阅qentrylement.h file@property(nonatomic,getter=IsSecureTextertry)BOOL secureTextEntry中的这一行;