문제

I have tried to load some code that uses

SystemChangeNotifier notify: self
ofSystemChangesOfItem: #class
using: #method.

I know this should be changed to SystemAnnouncer however this class seems to require you to register for each different possible change, i.e. classAdded:, methodAdded: etc.

What is the equivalent of the above code that notifies on all changes?

도움이 되었습니까?

해결책

AFAICT that's no longer possible. I think it was a conscious decision to drop unspecified, general notifications for specific ones. In your case specifically this might be a bit of a bummer but in general it means that subscription to specific change events is much easier, and there are less announcements because the notification object knows what change it represents. Previously the subscriber would be notified about all changes and would have to create a set of checks to filter unwanted ones.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top