user2575926
user2575926

Reputation: 41

I wonder why I got freeze of app when call [NSUbiquitouskeyValueStore synchronize]

Sometimes it stops freezing after several minutes ago, sometimes I wait for 10 minutes and then force quit it. When stop and look in thread calls, I see semaphore trap from NSUbiquitouskeyValueStore _forceSynchronize method.

Upvotes: 2

Views: 246

Answers (3)

Sal
Sal

Reputation: 1238

If running in the simulator quit the simulator and build and run the app again.

Upvotes: 0

Julien
Julien

Reputation: 3477

Several questions:

  1. is it in the simulator, the device or in OS X?
  2. did you debug while trying to catch exceptions? (or more generally: did you check that there was no exception)?
  3. lastly: can you post the full backtrace of the hang?

Upvotes: 0

self
self

Reputation: 1215

This is what Apple states:

The NSUbiquitousKeyValueStore class provides a programmatic interface for storing small amounts of configuration data in iCloud. You use this class to synchronize information between instances of your application running on different devices owned by the same user. This class should be used to share noncritical data, such as preferences, between instances of your application. You should avoid using it to store data that is central to your application’s behavior.

This class is intended for storing only small amounts of data using the property list object types: NSNumber, NSString, NSDate, NSData, NSArray, or NSDictionary. You might use this data to create a more seamless experience for the user. For example, a magazine application running on multiple devices might store which edition of the magazine is being read and which page the user is currently reading. Do not use the key-value store to store general application data or data that requires frequent updates. The total amount of available space in your application’s key-value store is limited to 1 MB. (There is a per-key limit too, which currently is set to 1 MB, and a maximum of 1024 keys are allowed.) If you attempt to write data that exceeds these quotas, the write attempts will fail and the old values (if any) will remain in place.

Upvotes: 0

Related Questions