Ios CALayer:存档然后取消存档数据与原始对象不匹配

Ios CALayer:存档然后取消存档数据与原始对象不匹配,ios,objective-c,Ios,Objective C,我有一个UIButton,它的子视图是UITextView。UITextView有一个图层,其边框为彩色,宽度为1。当我归档UIButton然后取消归档它时,边框颜色和边框宽度变为零。如果我设置图层背景颜色,它在存档时和未存档时将保持不变,这使得这个bug非常混乱 UIButton textButton = ... NSData *data = [NSKeyedArchiver archivedDataWithRootObject:textButton]; UIButton *textButt

我有一个UIButton,它的子视图是UITextView。UITextView有一个图层,其边框为彩色,宽度为1。当我归档UIButton然后取消归档它时,边框颜色和边框宽度变为零。如果我设置图层背景颜色,它在存档时和未存档时将保持不变,这使得这个bug非常混乱

UIButton textButton = ...

NSData *data = [NSKeyedArchiver archivedDataWithRootObject:textButton];
UIButton *textButton2 = [NSKeyedUnarchiver unarchiveObjectWithData:data];
lldb调试输出显示边框颜色消失

(lldb) po  [[[textButton subviews] firstObject] layer] <CALayer:0x13445780; position = CGPoint (150 50); bounds = CGRect (0 0; 300 100); delegate = <UITextView: 0xdb20000; frame = (0 0; 300 100); text = ''; clipsToBounds = YES; autoresize = RM+BM; userInteractionEnabled = NO; gestureRecognizers = <NSArray: 0x13446430>; layer = <CALayer: 0x13445780>; contentOffset: {0, 0}>; sublayers = (<_UITextTiledLayer: 0x13448e80>, <CALayer: 0x13445d90>); masksToBounds = YES; allowsGroupOpacity = YES; borderColor = <CGColor 0xc09b6d0> [<CGColorSpace 0xbf28210> (kCGColorSpaceDeviceRGB)] ( 0.378437 0.5 0.13035 1 ); backgroundColor = <CGColor 0xbed1e10> [<CGColorSpace 0xbe65e70> (kCGColorSpaceDeviceGray)] ( 0 0 ); borderWidth = 1>

(lldb) po [[[textButton2 subviews] firstObject] layer] <CALayer:0x13443fe0; position = CGPoint (150 50); bounds = CGRect (0 0; 300 100); delegate = <UITextView: 0xdb2aa00; frame = (0 0; 300 100); text = ''; clipsToBounds = YES; autoresize = RM+BM; userInteractionEnabled = NO; gestureRecognizers = <NSArray: 0x13432ed0>; layer = <CALayer: 0x13443fe0>; contentOffset: {0, 0}>; sublayers = (<_UITextTiledLayer: 0x134447f0>, <CALayer: 0x13434740>); masksToBounds = YES; allowsGroupOpacity = YES; backgroundColor = <CGColor 0xbed1e10> [<CGColorSpace 0xbe65e70> (kCGColorSpaceDeviceGray)] ( 0 0 )>
(lldb)po[[[textButton子视图]第一个对象]层]
(lldb)po[[textButton2子视图]第一个对象]层]
边框的颜色有什么特别的吗?或者这真的是一个bug