사용자가 휴지통을 비우면 내 코코아 앱에 알림이 전송됩니다. 이것은 내가 지금까지 가지고있는 것이다 :사용자가 휴지통을 비우면 알림?
NSNotificationCenter *notCenter = [[NSWorkspace sharedWorkspace]
notificationCenter];
AppDelegate *mainController = [[AppDelegate alloc] init];
[notCenter addObserver:mainController
selector:@selector(handleTrashEmpty)
name:NSWorkspaceRecycleOperation object:nil];
그러나 사용자가 휴지통을 비울 때 아무 것도 나타나지 않을 때. 이 코드가 작동하지 않는 이유는 무엇입니까? 소스 : 목적지 : 파일 : 태그 :
당신이 /.Trashes을 모니터링 할 FSEvents API를 사용
observeValueForKeyPath : 메소드를 구현 했습니까? –
@RamyAlZuhouri 여기에 관여하는 KVO –