전자 책 리더를 개발 중이며 다음 문제가 발생했습니다. 내가 IBNction 메서드를 사용하여 NSNotification 일단 단추가 도청되면 inturn 호출하는 작업 메서드를 사용하고 있습니다. 처음에는 절대적으로 잘 작동합니다 ... IBAction 메소드는 버튼을 탭하는 evry time이라고해야합니다.이 작업을 완료 한 후에는 홈 페이지로 이동 한 다음 다시 돌아와 버튼을 다시 클릭해야합니다. 이것은 내가 문제에 직면하고있는 곳이다. ,NSNotification을 여러 번 제기했습니다.
//IBAction Method
if (sender.tag == PenToolAction) {
GLogInfo(@"Pen tool tapped");
[self hideSelf];
[[NSNotificationCenter defaultCenter] postNotificationName:PenToolActionInitialized object:nil];
}
여기서 [[NSNotificationCenter defaultCenter] addObserver :. ..]'전화? – Jilouc
나는 그것을 receivers 클래스의 ViewDidLoad 메서드에 넣었다. –