I'm trying to read/write data in extra class file which is public. (StoreData.swift)
My function :
func FetchName (NameforDate: String) -> NSString
{
var appDel:AppDelegate = (UIApplication.sharedApplication().delegate as AppDelegate)
var context:NSManagedObjectContext = appDel.managedObjectContext!
}
At line where is "(UIApplication.sharedApplication()." I get the error:
StoreData.swift:115:49: 'sharedApplication()' is unavailable: Use view
controller based solutions where appropriate instead.
I created App and Today Extension.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…