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"
精彩评论