-windowDidResize:
메서드는 창 대리자에서 호출됩니다. 창에 대한 대리자를 게시 한 메서드가있는 개체입니까?
이
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResizeNotification object:theWindow];
또 다른 방법은 새로운 블록을 사용하는 것입니다 관찰자가 더 이상 관심이 또는 할당 해제되고 없을 때,
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:theWindow];
과 :
대리인 이외의 경우, 당신은 할 수있다 기반 API를 NSNotificationCenter
으로 변경 :
id observation = [[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidResizeNotification object:theWindow queue:nil usingBlock:^(NSNotification *){
NSLog(@"test");
}];
// store/retain the observation for as long as you're interested in it. When it's deallocated, you stop observing.
감사합니다. 그러나 어떤 방법으로해야합니까? 이것을 써라 – Pavel
나는 이것을하고있다, 모든 일 – Pavel