swift - Unsafe mutable addressor crash -
i have struct
, sometimes, users, there crash when trying access variable of type.
struct appsettings { var mute:bool { didset { if mute != oldvalue { let savedsettings = nsuserdefaults.standarduserdefaults() savedsettings.setbool(mute, forkey: key_setting_mute) } } } init() { let savedsettings = nsuserdefaults.standarduserdefaults() if let savedmute = savedsettings.objectforkey(key_setting_mute) as? bool { mute = savedmute } else { mute = false } } } var appsettings = appsettings()
and someplace during startup of app crashes
if appsettings.mute { // cause crash } // in appdelegate or methods calls
this users , cannot seem reproduce it. not being reproduce worst because leaves me nothing work with.
searching unsafe mutable addressor
error doesn't because there no results.
Comments
Post a Comment