Mantener viva la herramienta de línea de comandos
¿Cómo mantendría una herramienta de línea de comandos ejecutándose para siempre?
Este es mi código:
#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;
}