Can UIView be copied?

后端 未结 6 1603
广开言路
广开言路 2020-11-27 15:02

Simply using this way:

UIView* view2 = [view1 copy]; // view1 existed

This will cause simulator can not launch this app.

Try retai

6条回答
  •  暖寄归人
    2020-11-27 15:39

    Your app probably crashes with something like:

     [UIView copyWithZone:]: unrecognized selector sent to instance 0x1c6280
    

    The reason is that UIView does not implement the copying protocol, and therefore there is no copyWithZone selector in UIView.

提交回复
热议问题