摘要:
1.出现错误 'URLWithString' is unavailable: use object construction 'NSURL(string:)' 使用构造函数,而不是类方法创建url NSURL.URLWithString("xxx")改成NSURL(string:"xxx") 阅读全文
摘要:
Swift中,直接在类的外面调用类内部的方法,会出现Bug:Expressions are not allowed at the top level。 原因是: 在App工程里, .swift 文件都是编译成模块的,不能有 top level code。 先明确一个概念,一个 .swift 文件执行 阅读全文