NotificationCenter Solution


#1

The challenges were not tough. But here you go in case you were curious


#import <Foundation/Foundation.h>
#import "BNRLogger.h"
typedef void (^notificationCenterBlock)(NSNotification *);

int main(int argc, const char * argv[])
{

    @autoreleasepool {
        
        notificationCenterBlock passABlock;

[[NSNotificationCenter defaultCenter]
         addObserverForName:NSSystemTimeZoneDidChangeNotification
                     object:nil
                      queue:nil
                 usingBlock: passABlock = ^(NSNotification *note) {
                     NSLog(@"The system time zone has changed!");
                 }];

#2

Or just eliminate the typedef and the dummy variable “passABlock” and pass the block anonymously.