菜鸟教程小白 发表于 2022-12-12 09:15:43

ios - iOS/OSX 框架中的数据绑定(bind)


                                            <p><p>我想知道是否有任何我不知道的框架可以用来实现数据绑定(bind)的概念,将 NSObject 派生类(模型)绑定(bind)到 UIControl/NSControl 派生组件属性。</p>

<p>例如,我有一个带有属性 <code>name</code> 的类,我需要将它绑定(bind)到 UITextView <code>text</code> 属性,以便当模型的 <code>name</code> 属性更改 UITextView <code>text</code> 属性更新。</p>

<p>我猜在 <a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html" rel="noreferrer noopener nofollow">Key-Value Observing</a> 上会有一些东西。概念。</p>

<p>我想要在 OSX 和 iOS 或任何其他相关平台框架中工作的东西。</p>

<p>谢谢。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您正在寻找 <a href="https://github.com/ReactiveCocoa/ReactiveCocoa" rel="noreferrer noopener nofollow">ReactiveCocoa</a> -super 棒的框架,完全符合您的要求等等。也是实现<a href="https://github.com/Machx/MVVM-IOS-Example" rel="noreferrer noopener nofollow">MVVM</a>的好方法- 他们有很酷的扩展,可以实现 <a href="https://github.com/ReactiveCocoa/ReactiveViewModel" rel="noreferrer noopener nofollow">ReactiveViewModel</a>以及 <a href="https://github.com/CodaFi/AFNetworking-RACExtensions" rel="noreferrer noopener nofollow">AFNetworking</a> 的扩展名</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - iOS/OSX 框架中的数据绑定(bind),我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/22984074/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/22984074/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - iOS/OSX 框架中的数据绑定(bind)