NSApp/sharedApplication and the app delegate.

The proper fix - instead of (invalid) cast sharedApplication must be used.
NSApp is 'id' and compiler failed to find anything except stupid setDelegate:id<BLABLA>,
it does not mean we have to cast to BLABLA.