I am attempting to create an access method to a singleton. I am getting this error (see code below). I don't understand why I am getting this error and what this error means. Can anyone explain?
@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'