Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete iCloud Key-Value Data

I'm using the iCloud Key-Value Data storage solution, so I'm not working with documents (UIDocument). I've got the syncing implemented, and it seems to work well. However, I need to do some more detailed testing, now, and I can't figure out how to force delete the data on iCloud.

How can I delete data from my iCloud account for testing purposes?

I've tried this:

[[NSUbiquitousKeyValueStore defaultStore] setArray:[[NSArray alloc] init] forKey:@"iCloud_BG_KEY"];

I've also tried this:

[[NSUbiquitousKeyValueStore defaultStore] setArray:nil forKey:@"iCloud_BG_KEY"];

As well as turning off iCloud Backup for my app (Settings > iCloud > Storage & Backup > Manage Storage > [my_backup_device] > Show All Apps > [my app]).

And of course, I'm deleting my app and rebuilding and running xcode.

How can I force delete of the iCloud files (again, for Key-Value data storage)?

like image 579
thephatp Avatar asked Jan 17 '23 11:01

thephatp


1 Answers

How about

[[NSUbiquitousKeyValueStore defaultStore] removeObjectForKey:@"key"];

?

like image 126
jimpic Avatar answered Jan 23 '23 08:01

jimpic