Sto tentando di creare un metodo di accesso a un singleton. Sto ottenendo questo errore (vedi il codice sotto). Non capisco perché sto ricevendo questo errore e cosa significa questo errore. Qualcuno può spiegare?Membro statico non può essere utilizzato su istanza di tipo
@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'
'AppDelegate.thedelegate = self' –
che è la soluzione a questo problema, ma Sasha ha spiegato – andrewz