我正在try 创建一个单例的访问方法.我得到了这个错误(见下面的代码).我不明白我为什么会犯这个错误,这个错误意味着什么.有人能解释一下吗?
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
static private var thedelegate: AppDelegate?
class var delegate : AppDelegate {
return thedelegate!
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
thedelegate = self // syntax error: Static member 'thedelegate' cannot be used on instance of type 'AppDelegate'