开发者

Implementing Cocoa Bindings pattern

I have a class MyImage, that have a NSAffineTransform member transform.

In my AppDelegate a have a NSMutableArray of images.

I have a MyView that draw the images from AppDelegate.images. So it must track changes in AppDelegate.images and redraw th开发者_C百科e content.

What is the best way to implement this though bindings?


You don't mean bindings, or if you do you have misunderstood how bindings work and what they are for.

For an explanation read this post - Manual binding in Cocoa

You need to use KVO to observe the array of images. You need to make sure you add and remove images from the array in a KVC compliant way.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜