0
내 FirstViewController에서 내 SecondViewController 메서드를 실행하려고합니다.이 메서드는 cuz라고 불립니다. 로그 콘솔에서 내 메시지 (NSLog (@ "printSomething"))를 봅니다. . 문제는 해당 메서드에서 UIToolBar를 이동하려고하지만 그렇지 않다는 것입니다. 나는 다른의 ViewController에서 호출 할 때 UIToolBar 이동,하지만 ... 메소드가 실행 작동 자신의 ViewController에서 메소드를 호출하지만, UIToolBar는 아무 것도 설정하지 않으면다른 클래스의 toolBar 애니메이트
FirstViewController.m
UIBarButtonItem *flipButton = [[UIBarButtonItem alloc]
initWithTitle:@"Opciones"
style:UIBarButtonItemStyleBordered
target:secondViewController
action:@selector(showOptions)];
SecondViewController.m
-(void)showOptions{
NSLog(@"printSomething");
[self.toolBar setFrame:CGRectMake(0, 40, 320, 50)];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.35];
[self.toolBar setFrame:CGRectMake(0, 180, 320, 50)];
[self.toolBar setUserInteractionEnabled:YES];
[UIView commitAnimations];
} UR 리플레이에 대한
감사합니다.
0x0을 출력합니다. 어쨌든 어떻게 작동해야합니까? –
이것은 변수가 null이라는 것을 의미합니다. 아무 것도 가리 키지 않습니다. 도구 모음에 대한 유효한 참조를 두 번째보기 컨트롤러에 제공해야합니다. 두 번째 뷰 contoller를 인스턴스화 할 때이를 매개 변수로 전달한 다음 self.toolbar = MyToolbarParameter를 수행 할 수 있습니다. – Rayfleck