Ing. Ron
Ing. Ron

Reputation: 2095

Best practice to store a small amount of data (NSMutableDictionary) permanent on the WatchOS2

With the new architecture of WatchOS2, watch apps can run stand alone without a connection to the iPhone. What would be the best practice to store a small amount of data (by example a NSMutableDictionary), which normally would be stored in the NSUserdefaults. NSUserdefaults is not working on WatchOS2.

Concrete: When the app runs for the first time some data are collected, stored in the NSUserdefaults on the iPhone and than transferred via WatchConnectivity to the Apple watch.

If the user runs the next time the app stand alone on the Apple watch I need that data ton be retrieved.

Upvotes: 1

Views: 421

Answers (1)

Candost
Candost

Reputation: 1029

You can use NSUserDefaults to store data locally. To share your data between Apple Watch and iPhone, you should use WatchConnectivity. As you said in comment, there is an another question-answer about NSUserDefaults here.

Upvotes: 4

Related Questions