开发者

Make a copy of object

I have a UIScrollView on it I have UIImageView's and UIButton, when I create temp UIScrollView and try 开发者_JAVA技巧to do something like this:

for (UIView *viewCopy in scrollView.subviews) 
{
       [tempScrollView addSubview:viewCopy];
}

Pointer of each subview on scrollView disappearing. I need make a copy of each object? How to make a copy of UIImageView and UIButton? Thanks..


UIImageView and UIButton, being derived from UIView, do not conform to the NSCopying protocol. So, you cannot make a copy.

You can instantiate multiple time UIImageView and UIButton and have as many objects as you need.

In any case, it is not clear what you mean by: "Pointer of each subview on scrollView disappearing"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜