Using NSUserDefaults for storing UISwitch state

前端 未结 2 937
梦如初夏
梦如初夏 2021-01-25 17:47

I am trying to persist the UISwitch state in my settings view of my application. Basically it is a UITableView and contains a few switches to get the u

2条回答
  •  离开以前
    2021-01-25 18:26

    Instead of using setObject:forKey: try using setBool:forKey:.

    [[NSUserDefaults standardUserDefaults] setBool:TRUE forKey:@"SyncAtStartup"];
    

提交回复
热议问题