試圖建立XCGLogger和接收錯誤:XCGLogger:不明確的參考成員「登陸」
Ambiguous reference to member 'log'
我看到這個問題已經raised但我不是在溶液變透明..
在單獨源文件
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
let log = XCGLogger.defaultInstance()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
log.setup(.Debug, showThreadName: true, showLogLevel: true, showFileNames: true, showLineNumbers: true, writeToFile: nil, fileLogLevel: .Debug)
return true
}
然後:
0每安裝指南加入這個全局變量到AppDelegate.swiftimport XCGLogger
log.debug("A debug message")
什麼是正確的用法?
凡在AppDelegate中沒有你把代碼?它是在AppDelegate類還是全局? – ryantxr
'nameOfYourProject.log.debug'?但可能將'log'重命名爲其他內容會更好。你能找到碰撞標識符「log」嗎? – Sulthan
@ryantxr:更新的問題 –