2012-09-04 2 views
0

원하는보기 컨트롤러에 연결되어 있지 않은 카메라보기 위에 오버레이 UIView로 나타나는 정보 단추가 있습니다. 만졌을 때 아무 일도 일어나지 않습니다. 여기 정보 단추가 다른보기 컨트롤러에 연결되지 않습니다.

버튼을 만들고 여기에

// Create a Button to get Help 
    infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight ] ; 
    CGRect buttonRect = infoButton.frame; 

    // Calculate the bottom right corner 
    buttonRect.origin.x = 455; 
    buttonRect.origin.y = 297; 
    [infoButton setFrame:buttonRect]; 

    [infoButton addTarget:self action:@selector(presentInfo) forControlEvents:UIControlEventTouchUpInside]; 
    [view addSubview:infoButton]; 

을 시도해보십시오 SEGUE에게

- (void) presentInfo 
{ 
InfoViewController *ivc = [self.storyboard instantiateViewControllerWithIdentifier:@"InfoViewController"]; 
[self presentModalViewController:ivc animated:YES]; 
} 
+0

카메라를 기각하고, 호출 시도 ... 나는이

오 도움이 또는 당신이 만드는 UITapGestureRecognizer을 시도하고 그것을 줄 희망하지만 아무것도 다른 작동하지 않는 경우이 만 실제 절망적 인 솔루션입니다 카메라 해지 완료 핸들러에서 뷰 변경. –

답변

1

를 만들 수있는 코드 연결하는 코드 첫 번째 : - :

가에 중단 점을 설정
- (void) presentInfo 
{ 
InfoViewController *ivc = [self.storyboard instantiateViewControllerWithIdentifier:@"InfoViewController"]; 
[self presentModalViewController:ivc animated:YES]; 
} 

프로그램이이 시점에 도달하면 해당 프로그램에 문제가 있어야합니다.

이번 주에도 버튼에 약간의 문제가있었습니다. 내 경우에는 한 번 다른 단추를 통해 UIView 있었는데, 그래서 선택기 충돌하지 않습니다. 또는 시도하고 변경할 수 있습니다

[infoButton addTarget:self action:@selector(presentInfo) forControlEvents:UIControlEventTouchUpInside]; 

에서 : 버튼이 다른 이미지와 터치에 반응하는 경우

[infoButton addTarget:self action:@selector(presentInfo) forControlEvents:UIControlEventTouchDown]; 

은 또한 본다.

+0

팁 주셔서 감사합니다! 내 선택기에 문제가 발생했습니다. 브레이크 포인트 솔루션이 도움이되었습니다. – user1486548

관련 문제