开发者

Bind value to nth object of array

开发者 https://www.devze.com 2023-02-09 07:00 出处:网络
I have an NSView and an NSArrayController and I\'d like to bind some values inside tha开发者_运维知识库t view to an object in the array controller\'s arrangedObjects array. How would I do this? I thou

I have an NSView and an NSArrayController and I'd like to bind some values inside tha开发者_运维知识库t view to an object in the array controller's arrangedObjects array. How would I do this? I thought about creating a property like "currentObject" and bind everything to that. But this seems ugly to me..

(I only have one view for all the objects but the user should be able to click on next and backward.)


What are you really trying to accomplish? Normally a "detail view" is bound to the array controller's selection, not an object at a given index. If you'll always be wired to the same object, just use an NSObjectController, set its content object to the desired one and bind your view to it instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消