我得到一个 EXC_BAD_ACCESS。我已经尝试了所有有关不良访问的建议,但没有运气。我知道这是我设置 UIImageView 框架时造成的。
这是代码...
_backImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cardback_brothers_royal"]];
CGRect imageFrame = _backImageView.frame;
imageFrame.origin.x = -9;
imageFrame.origin.y = -9;
imageFrame.size.width = 151;
imageFrame.size.height = 225;
_backImageView.frame = imageFrame;
回溯:
0 0x33cf3a22 in -[UIView(CALayerDelegate) actionForLayer:forKey:] ()
1 0x33aa201e in -[CALayer actionForKey:] ()
2 0x33aa1fce in actionForKey(CALayer*, CA::Transaction*, NSString*) ()
3 0x33aa1eba in CA::Layer::begin_change(CA::Transaction*, unsigned int, objc_object*&) ()
4 0x33a9d9e6 in CA::Layer::set_position(CA::Vec2<double> const&, bool) ()
5 0x33a9d8a2 in -[CALayer setPosition:] ()
6 0x33a9d832 in -[CALayer setFrame:] ()
7 0x33cf2aec in -[UIView(Geometry) setFrame:] ()
8 0x33cf2814 in -[UIImageView _setViewGeometry:forMetric:] ()
9 0x33cf2752 in -[UIImageView setFrame:] ()
10 0x0006cd88 in -[CardView loadBack]