-1
在我的应用程序委托中,我有一个连接到不同视图的UIButton的IBOutlet。该视图显示如下:在不同视图中隐藏UIButton?
// .h
IBOutlet UIView *theToolbar;
// .m
[window addSubview:theToolbar];
theToolbar.frame = CGRectMake(0, 425, 320, 44);
这里就是我做的这一切在我的应用程序委托:
// .h
IBOutlet UIButton *disbledCameraButton;
@property (copy, readwrite) UIButton *disabledCameraButton;
// .m
@synthesize disabledCameraButton;
最后,我试图把它藏在一个不同的类:
#import "TableViewAppDelegate.h"
TableViewAppDelegate *dataCeter = (TableViewAppDelegate *)[[UIApplication sharedApplication] delegate];
dataCeter.disbledCameraButton.hidden = YES;
不过,我得到这个错误:
accessing unknown disabledCameraButton getter Method
这是为什么这样做?谢谢。
我傻......哇......我觉得自己很蠢......也只好用'非原子,retain'财产。 – iosfreak 2011-05-15 23:45:55