【发布时间】:2020-02-27 20:03:09
【问题描述】:
我正在使用 THEOS,并且我知道如何挂钩方法和覆盖等等。但现在我想做的是,我想访问在 (@interface) 中声明的 UI 视图。
这里是我指的头文件:
@class NSString, UILabel, UINavigationBar, UISwitch;
__attribute__((visibility("hidden")))
@interface SettingsViewController : UIViewController <UINavigationBarDelegate, UIBarPositioningDelegate>
{
UINavigationBar *navBar;
UISwitch *alertSwitch;
UISwitch *lightSwitch;
UISwitch *lockSwitch;
UISwitch *infoSwitch;
UILabel *alertLabel;
UILabel *lightLabel;
UILabel *lockLabel;
UILabel *showInfoLabel;
UILabel *infoLabel;
}
@property(retain, nonatomic) UILabel *infoLabel; // @synthesize infoLabel;
@property(retain, nonatomic) UILabel *showInfoLabel; // @synthesize showInfoLabel;
@property(retain, nonatomic) UILabel *lockLabel; // @synthesize lockLabel;
@property(retain, nonatomic) UILabel *lightLabel; // @synthesize lightLabel;
@property(retain, nonatomic) UILabel *alertLabel; // @synthesize alertLabel;
@property(retain, nonatomic) UISwitch *infoSwitch; // @synthesize infoSwitch;
@property(retain, nonatomic) UISwitch *lockSwitch; // @synthesize lockSwitch;
@property(retain, nonatomic) UISwitch *lightSwitch; // @synthesize lightSwitch;
@property(retain, nonatomic) UISwitch *alertSwitch; // @synthesize alertSwitch;
@property(retain, nonatomic) UINavigationBar *navBar; // @synthesize navBar;
- (void).cxx_destruct;
- (void)didReceiveMemoryWarning;
- (void)dismissSettingsViewController;
- (long long)preferredStatusBarStyle;
- (void)showDevInfo;
- (void)infoSwitchSwitched;
- (void)lockSwitchSwitched;
- (void)lightSwitchSwitched;
- (void)alertSwitchSwitched;
- (void)viewDidLoad;
- (long long)positionForBar:(id)arg1;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
我想访问@interface 下的 UI 视图(例如:UISwitch *alertSwitch;)。
如何访问它?请帮助我自三天以来一直在努力解决问题:(。非常感谢任何帮助或建议。
【问题讨论】:
标签: objective-c model-view-controller interface theos