I am building a project at the moment, if users set the default time is 20 minutes in View Controller A and users need to use this time as a timer in Controller B. I understand the data can be passed by delegation or notification, etc. What I am try to approach this by saving users' selection in View Controller A and retrieve in Controller B. The approach include Core data, plist and NSUserdefault. Which one should I use in this case? Meanwhile, I am thinking the users' setting should be sync between iOS and Mac as well. Thanks in advance.
Asked
Active
Viewed 26 times
1 Answers
1
You can use NSUserDefaults
. It is fine. But what do you mean by synching between iOS and Mac? Do you mean Handoff between devices??

badhanganesh
- 3,427
- 3
- 18
- 39
-
No, I mean sync the setting information between iOS and Mac. I think iCloud would be the best one – Nan May 28 '17 at 00:21
-
One more thing is, how multiple View Controller can access the NSUserDefaluts? – Nan May 28 '17 at 03:35
-
UserDefaults provides a singleton instance for your app, so anywhere in your app UserDefaults can be accessed and written to. – badhanganesh May 28 '17 at 05:28