H
@property (nonatomic, strong) IBOutlet UIScrollView *itemsContainer;
@property (nonatomic, strong) UIScrollView *itemsContainerDefaults;我
- (void)awakeFromNib
{
self.itemsContainerDefaults = [self.itemsContainer copy]; // breaks here
}控制台
2013-02-27 19:09:07.585 Test App[2038:907] -[UIScrollView copyWithZone:]: unrecognized selector sent to instance 0x1ddcde60
2013-02-27 19:09:07.586 Test App[2038:907] Uncaught exception: -[UIScrollView copyWithZone:]: unrecognized selector sent to instance 0x1ddcde60
2013-02-27 19:09:07.601 Test App[2038:907] Stack trace: ( ... )我尝试将itemsContainer复制到itemsContainerDefaults,但在日志中遇到错误。为什么这不起作用?
发布于 2013-02-28 08:19:19
为了在对象上调用-copy,它必须符合NSCopying。UIScrollView不需要。
我认为你想要实现的目标有一个更好的方法。但我不确定你想要达到什么目的。您想制作滚动视图的可视副本吗?为什么不创建一个新的滚动视图,它使用与第一个滚动视图相同的数据源?
https://stackoverflow.com/questions/15125148
复制相似问题