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

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -