我在编辑方面有问题。
这是在自动生成的“MyProject-Swit.h”文件中。
SWIFT_CLASS("_TtC3sfw17ContentKeyManager")
@interface ContentKeyManager : NSObject <AVContentKeySessionDelegate>
- (void)contentKeySession:(AVContentKeySession * _Nonnull)session didProvideContentKeyRequest:(AVContentKeyRequest * _Nonnull)keyRequest;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end类型参数'AVContentKeySession‘必须是指针(需要' *’)插入‘*’类型参数不能应用于非参数化类'NSObject‘删除’未知类名'AVContentKeySessionDelegate';您的意思是'AVContentKeySession‘吗?将“AVContentKeySessionDelegate”改为“AVContentKeySession”
代码:
import Foundation
import AVFoundation
class ContentKeyManager: NSObject, AVContentKeySessionDelegate {XCode 14.0.1 Swift 5
如何解决此错误?
发布于 2022-11-04 10:49:25
此代码在Xcode14上编译:
import Foundation
import AVFoundation
class ContentKeyManager: NSObject, AVContentKeySessionDelegate {
func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) {
}
}你能详细解释一下你为什么会犯这个错误吗?
https://stackoverflow.com/questions/74306125
复制相似问题