我尝试过使用juggernaut cocoa:
https://github.com/fpotter/juggernaut-cocoa
在我的代码中添加了这一行:
JuggernautClient *client = [[JuggernautClient alloc] initWithHost:@"myhost" port:1740];
[client subscribe:[NSString stringWithFormat:@"/reports/%@/new", current_unit.unit_id]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didReceiveMessage:)
name:JuggernautDidReceiveMessageNotification
object:nil];
我收到以下错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_JuggernautClient", referenced from:
objc-class-ref in MapViewController.o
"_JuggernautDidReceiveMessageNotification", referenced from:
-[MapViewController viewDidLoad] in MapViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
感谢您的回复
答案 0 :(得分:0)
当我看到这个错误时:
ld: symbol(s) not found for architecture i386
告诉我JuggernautClient.m未包含在构成应用目标的文件集合中。转到JuggernautClient.m的文件检查器并将其设置为包含在您的构建中。
这是一个略有不同的图片,但我从a related question's answer I also gave.
中选择了它