Подтвердить что ты не робот

Удерживайте инструмент командной строки

Как будет работать инструмент командной строки навсегда.

Это мой код:

#import <Foundation/Foundation.h>

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

    @autoreleasepool {

        [[NSDistributedNotificationCenter defaultCenter] addObserverForName:nil object:nil queue:nil usingBlock:^(NSNotification *notification)
         {
             NSLog(@"%@", notification);
         }];

        //Keep alive...

    }
    return 0;
}
4b9b3361

Ответ 1

Вам нужно войти в runloop, используя CFRunLoop или NSRunLoop.

Try:

[[NSRunLoop currentRunLoop] run];

Ответ 2

В Swift 4,

RunLoop.current.run()

Приветствия.