「「-addSubView」メソッドが見つかりません」というメッセージが表示されます
サブビューをウィンドウに追加しようとすると、この場合はボタンを追加しようとします。これが私のコードです
@interface SBUIController
-(id)window;
@end
@interface SBAwayView
-(void)chargingView;
-(void)showChargingView;
-(void)hideChargingView;
-(void)showBulletinView;
-(BOOL)shouldShowChargingView;
-(void)hideCameraButton;
@end
%hook SBAwayController
-(void)_tearDownCameraPreview{
//SBAwayView *v = MSHookIvar<id>(self, //"_awayView");
UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; myButton.frame = CGRectMake(21, 80, 100, 35); [myButton setTitle:@"My Button" forState:UIControlStateNormal];
SBUIController *ui = MSHookIvar<id>(self, "_uiController");
[[ui window] addSubView:myButton];
%orig; }
%end