我正在尝试构建一个使用Growl的基本可可应用程序。有没有办法使用GrowlApplicationBridge没有NSClassFromString?
每次我想用GrowlApplicationBridge
我有使用类似
Class GAB = NSClassFromString(@"GrowlApplicationBridge");
[GAB performSelector:@selector(setGrowlDelegate:) withObject:self];
我希望能够只使用
[GrowlApplicationBridge setGrowlDelegate:self];
这里的编译器错误,我得到的,当我尝试我想要的行为:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GrowlApplicationBridge", referenced from: objc-class-ref in StatusMenuAppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
谢谢:)我在复制框架而不是链接它。 – Cyrus
@Cyrus:你需要做这两件事。如果你不复制它,你的应用程序将无法启动,因为你的用户不会拥有它。如果你没有链接它,复制它是没有用的。您必须复制它(以便它会出现在用户的机器上)并链接到它(以便您的应用程序将实际使用它)。 –
明白了。谢谢你的帮助。 – Cyrus