0
Ну, я не могу заставить это работать. Моя цель - добавить UIButton в Minecraft Pocket Edition. Я думаю, что проблема проста или очевидна, поэтому, пожалуйста, не стесняйтесь маленькой стеной кода.Цель C Theos UIView не работает
Благодаря Су много, Kivifreak
#import <substrate.h>
#import <UIKit/UIKit.h>
@interface Tpschanger
UIButton *myButton;
UIView *myView;
-(void) TPSButton;
@end
%hook minecraftpeViewController
-(void)viewDidLoad {
myView=[[UIView alloc]initWithFrame:CGRectMake(0,0,320,480)];
myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
myButton.frame = CGRectMake(20, 20, 200, 44);
[myButton setTitle:@"TPS" forState:UIControlStateNormal];
[myButton addTarget:self action:@selector(TPSButton:) forControlEvents:UIControlStateNormal];
[self.myView addSubview:myButton];
> I get an error at the previous line: request for member ‘myView’ in ‘self’, which is of non-class type ‘minecraftpeViewController*’
%orig;
}
%new
-(void) TPSButton {
}
%end