gpt4 book ai didi

xcode - 有没有办法在没有 NSClassFromString 的情况下使用 GrowlApplicationBridge?

转载 作者:行者123 更新时间:2023-12-03 17:05:12 26 4
gpt4 key购买 nike

我正在尝试构建一个使用 Growl 的基本 cocoa 应用程序。

每次我想使用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)

最佳答案

只要您导入<Growl/Growl.h>在该文件的顶部并将框架链接到您的应用程序中,您应该能够使用 [GrowlApplicationBridge setGrowlDelegate:self]就好了。

检查文件顶部并确保正在导入它,然后检查目标的“链接库和框架”构建阶段并确保正在链接它。

关于xcode - 有没有办法在没有 NSClassFromString 的情况下使用 GrowlApplicationBridge?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10628220/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com