This is just a workaround. It may be removed in the final release of OS X 10.11 and Xcode 7.
In 10.11 DP, the NSMenuDidChangeItemNotification fires whenever a new menu item is "adding",
of course including the item we're trying to add now.
I agree it's a bug because "DidChange" should be notified AFTER the changes.
Similar bug is reported in Xcode plug-in "FuzzyAutoComplete"'s issue, which is considered as
a bug introduced by 10.10.2-dp(which is fixed in 10.10.2 final release):
This is just a workaround. It may be removed in the final release of OS X 10.11 and Xcode 7. In 10.11 DP, the NSMenuDidChangeItemNotification fires whenever a new menu item is "adding", of course including the item we're trying to add now. I agree it's a bug because "DidChange" should be notified AFTER the changes. Similar bug is reported in Xcode plug-in "FuzzyAutoComplete"'s issue, which is considered as a bug introduced by 10.10.2-dp(which is fixed in 10.10.2 final release):