Objective-C をサポートするために、最近 *.cpp から *.mm に名前を変更した C++ クラスがあります。したがって、次の Objective-C コードを追加できます。
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(notificationHandler:)
name:@"notify"
object:nil];
- c++ で notificationHandler メソッドを作成するにはどうすればよいですか?
- addObserver:self プロパティの設定は機能しますか?