How to declare NSString constants for passing to NSNotificationCenter

后端 未结 6 401
无人及你
无人及你 2020-12-24 02:29

I\'ve got the following in my .h file:

#ifndef _BALANCE_NOTIFICATION
#define _BALANCE NOTIFICATION
const NSString *BalanceUpdateNotification
#endif
         


        
6条回答
  •  醉话见心
    2020-12-24 02:54

    This is the working solution to declare NSString name for observers.

    static NSString *const MyCustomNotificationName = @"MyCustomNotificationName";
    

提交回复
热议问题