有什么技术/概念的原因,为什么iOS不支持Cocoa Bindings? [英] Is there any technical/conceptual reason why iOS does not support Cocoa Bindings?

查看:202
本文介绍了有什么技术/概念的原因,为什么iOS不支持Cocoa Bindings?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cocoa for Mac OS X支持Cocoa Binding技术,减少你的视图和模型之间需要粘合代码。

Cocoa for Mac OS X support Cocoa Binding technology, reducing need of glue code between your views and your models.

在KVC上重新创建KVC的Cocoa Bindings可以在cocotron源代码的帮助下。

Recreating Cocoa Bindings on top of KVC on KVO seems doable with the help from cocotron source code.

有没有任何技术或概念上的原因,为什么Cocoa Bindings不是SDK的一部分?
我正在考虑性能,缺乏垃圾收集,缺乏来自UI元素的KVC支持(例如UISlider)。

Is there any technical or conceptual reason why Cocoa Bindings are not part of the SDK ? I'm thinking about performance, lack of garbage collection, lack of KVC support from UI elements (UISlider for instance).

推荐答案

桌面上的绑定需要:


  1. 所有合适的UI组件都会暴露绑定的重要属性

  2. 执行 NSArrayController 用于处理选择的基础设施

  1. All suitable UI components to expose bindings for their important properties
  2. Implementation of NSArrayController infrastructure for handling selection



<点2变得不太成问题。这是罕见的(甚至可能是一个坏的UI设计)有一个主 - 细节视图布局,可以进行多重选择。这是 NSArrayController 真的属于自己。

UITableView的绑定变得不太实用,因为当前 NSArrayController 设计不能扩展到多个部分,标题等。

Bindings for a UITableView become less practical as the current NSArrayController design doesn't stretch to multiple sections, titles etc.

点1将是有用的。然而,它需要大量的工作,以在所有UIKit控件中实现绑定支持。我认为它永远不会成为他们实施的高优先级。

Point 1 would be useful to have. However it requires a large quantity of work by Apple to implement bindings support in all the UIKit controls. I assume it's never become a high enough priority for them to implement.

这篇关于有什么技术/概念的原因,为什么iOS不支持Cocoa Bindings?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆