我正在研究swift和objective-c混合项目。我将一个名为JSTManager.h的类重写为Manager.swift。然后,我删除了JSTManager.h和JSTManager.m。 Manager.swift用于swift和objective c文件。项目编译并成功运行,但Xcode在成功成功后显示警告。警告就像,
代码:[Manager sharedInstance]
警告:Unknown receiver 'SoundManager'; did you mean 'NSUndoManager'?
警告:No known class method for selector 'sharedInstance'
如何删除这些警告?
Manager.swift就像
class Manager: NSObject {
var player: AVPlayer?
static let sharedInstance = Manager()
override init() {
super.init()
}
}
答案 0 :(得分:-1)
使用
class Manager: NSObject {
var player: AVPlayer?
static let sharedInstance = Manager()
override init() {
super.init()
}
}