NSLog(@“%@”,NSStringFromCGRect([(UIButton *)[array lastObject] frame]));

时间:2013-11-26 06:35:49

标签: ios objective-c arrays

NSLog(@" %@",NSStringFromCGRect([(UIButton*)[array lastObject]frame]));

此声明中的错误是什么。我的代码破了  错误 [__NSArrayI frame]:无法识别的选择器发送到实例0x1c5f2e00

1 个答案:

答案 0 :(得分:1)

检查此代码

UIButton *btn = (UIButton *)[array lastObject];

if(btn)
{

  NSLog(@" %@",NSStringFromCGRect(btn.frame));
}