0

我有一个UIImageView我正在制作动画(使用UIView's commitAnimations)并且我正在使用NSObject's移动它以performSelectorInBackground:获得更好的性能。现在我的问题是,是否可以在UIImageView使用单独的线程移动时更改修改图像?一切似乎都运行良好,但我想问一下,因为我知道你应该在启动新线程时复制数据。

我正在使用UIImageView's setImage:,它没有记录但有效。UIImageView.image使用财产会更好吗?提前致谢 :)

4

1 回答 1

0

Setting a property is equivalent to invoking its corresponding setter method. It's documented, you just haven't noticed it: having a (read-write) property named 'image' implicitly means having an

- (UIImage *)image;

and a

- (void)setImage:(UIImage *)img;

method.


You should always perform UI operations on the main thread. Even if it works now, it may break once.

于 2012-07-04T21:47:33.540 回答