2014-04-18 6 views
0

내 코드에 어떤 문제가 있습니까 ?? 나는 감옥 전체 개발 과정에 약간 새로운 편이다. 누구든지 이걸 도와 주면. 내가 배운 새로운 것을 시험해보고 싶었고 홈 화면에 UIAlertView를 생성하는 UIButton을 표시하려고했습니다.UIButton이 작동하지 않음 iOS 7이 작동하지 않음 장치

단순히 추가

%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([email protected]:) 
-(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 
+0

예외 당신입니다 만나다? – Dima

답변

0

@selector (myButtonPressed) : 내 버튼이 때문에 누른 후

@selector하게는 (myButtonPressed :

코드 충돌을 수행하고 어떤