【发布时间】:2012-02-25 23:38:00
【问题描述】:
如何让命令行工具永远运行。
这是我的代码:
#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;
}
【问题讨论】:
标签: objective-c command-line-tool