我正在使用 NSLog 来检查 UITextView。我的代码中有以下日志记录语句:
NSLog(@"textView: %@",textView);
NSLog(@"textView.frame: %@",textView.frame);
NSLog(@"[textView frame]: %@",[textView frame]);
在控制台的输出中,我得到以下信息:
2010-11-29 22:00:38.252 MenuMaker[57602:207] textView: <UITextView: 0x3b3afe0; frame = (0 0; 320 387); text = 'blah...'; clipsToBounds = YES; autoresize = RM+BM; layer = <CALayer: 0x3b3afa0>>
2010-11-29 22:00:38.254 MenuMaker[57602:207] textView.frame: (null)
2010-11-29 22:00:38.254 MenuMaker[57602:207] [textView frame]: (null)
输出的第一行,因为它包含 'frame = (0 0; 320 387)' 位,让我相信 UITextView 的 frame 变量已全部设置。但是为什么在这种情况下接下来的两行显示为 null 呢?他们不应该转储框架的值吗?
提前致谢