Objective c 显示UIButton不工作导致iOS 7设备崩溃

Objective c 显示UIButton不工作导致iOS 7设备崩溃,objective-c,uibutton,theos,logos,Objective C,Uibutton,Theos,Logos,我的代码有什么问题??我对整个越狱开发过程有些陌生。如果有人能帮我的话。我试着对我学到的新东西进行测试,我试着在主屏幕上显示一个创建UIAlertView的UIButton %hook SBUIController - (void)finishLaunching { UIButton *myButton; myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; myButton.frame = CGRectMak

我的代码有什么问题??我对整个越狱开发过程有些陌生。如果有人能帮我的话。我试着对我学到的新东西进行测试,我试着在主屏幕上显示一个创建UIAlertView的UIButton

%hook SBUIController
- (void)finishLaunching
{
UIButton *myButton;
    myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    myButton.frame = CGRectMake(25, 85, 100, 35);
    [myButton setTitle:@"Test" forState: UIControlStateNormal];
    [myButton addTarget:self action:@selector(myButtonPressed) forControlEvents:UIControlEventTouchUpInside];

SBUIController *ui = MSHookIvar<id>(self, "_uiController");
    [[ui window] addSubview:myButton];
}

%new(v@:)
-(void)myButtonPressed{

UIAlertView *theAlert = [[UIAlertView alloc] initWithTitle:@"Title of Alert"      message:@"Message of Alert" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK",  nil];
[theAlert show];
[theAlert release];

}

%end
%hook-sbler
-(无效)完成发射
{
UIButton*myButton;
myButton=[UIButton按钮类型:UIButtonTypeRoundRect];
myButton.frame=CGRectMake(25,85,100,35);
[myButton设置标题:@“测试”状态:UIControlStateNormal];
[myButton addTarget:self action:@selector(myButtonPressed)for ControlEvents:UIControlEventTouchUpInside];
SBUIController*ui=MSHookIvar(self,“\u uiController”);
[[ui窗口]添加子视图:myButton];
}
%新的(v:)
-(无效)MyButton已按下{
UIAlertView*theAlert=[[UIAlertView alloc]initWithTitle:@“警报标题”消息:@“警报消息”委托:自取消按钮:无其他按钮:确定,无];
[theAlert show];
[警报释放];
}
%结束
@选择器(按下MyButton)

简单地加上:按下我的按钮后,它就变了


@选择器(myButtonPressed:)

代码在哪里崩溃,您看到的异常是什么?