gpt4 book ai didi

ios - 使用 AssetsLibrary.h 时出错

转载 作者:行者123 更新时间:2023-11-28 19:59:44 24 4
gpt4 key购买 nike

我的代码在我的源代码中如下所示:

+ (ALAssetsLibrary *)defaultAssetsLibrary {
static dispatch_once_t pred = 0;
static ALAssetsLibrary *library = nil;
dispatch_once(&pred, ^{
library = [[ALAssetsLibrary alloc] init];
});
return library;
}

当我尝试构建时,它给出错误:

  "_OBJC_CLASS_$_ALAssetsLibrary", referenced from:
objc-class-ref in Setting_Main.o //Setting_Main.o reflects name of my source file Setting_Main.h
ld: symbol(s) not found for architecture i386

现在,当我如下注释某行时,它不显示错误。但是,我无法获得图书馆的值(value)。

+ (ALAssetsLibrary *)defaultAssetsLibrary {
static dispatch_once_t pred = 0;
static ALAssetsLibrary *library = nil;
//dispatch_once(&pred, ^{
//library = [[ALAssetsLibrary alloc] init];
// });
return library;
}

谁能告诉我这里究竟出了什么问题?

最佳答案

这是链接错误,需要添加资源库

/System/Library/Frameworks/AssetsLibrary.framework

您项目的框架。

关于ios - 使用 AssetsLibrary.h 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24757298/

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