使用 NSValueTransformer 进行查询
1.在我的应用程序中,需要在表格列的每一行中显示某个值(3个不同的值中),可以通过检查两个不同模型键路径的值来决定每行中要显示的值。
我尝试使用绑定来实现这一点,其中我使用“使用一个键路径和自定义值转换器类显示模式值1”和“使用其他键路径和相同值转换器显示模式值2”。但是我没有从任何人都可以帮我解决这个问题吗?
2.在另一个应用程序中,有一个包含 3 列的表格视图,其中第一列显示完整的单词,第二列显示该单词的前缀,第三列显示该单词的后缀。
我使用绑定和两个自定义值转换器类实现了此要求。一个用于获取单词的前缀(prefixExtractor),另一个用于获取单词的后缀(suffixExtractor)。任何人都可以建议我如何仅使用来实现此要求一个自定义值转换器类,以便它优化我的代码。
提前致谢。
1.In my application there is a requirement to display certain value (among the 3 different values) in each row of the table column,the value to be displayed in each row can be decided by checking the values of two different model key paths.
This i tried to implement using bindings,where i used "Display pattern Value1 with one key path and custom value transformer class" and "Display pattern Value2 with other key path and same value transformer".But i am not getting desired output value from the transformer class.Can anyone please help me in resolving this issue.
2.In the other application there is a table view with 3 columns,where the first column displays the complete word,second column displays the prefix of that word and the third column displays the suffix of that word.
I implemented this requirement using bindings and two custom value transformer classes.One for getting the prefix of the word(prefixExtractor) and the other for getting the suffix of the word(suffixExtractor).Can anyone suggest me how can i implement this requirement using only one custom value transformer class so that it optimizes my code.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论