# iCloud

**URL:** <https://forum.xojo.com/t/icloud/10880>\
**Category:** macOS\
**Created:** [September 12, 2013, 11:23am UTC](https://forum.xojo.com/t/icloud/10880 "2013-09-12T11:23:14Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [September 12, 2013, 11:23am UTC](https://forum.xojo.com/t/icloud/10880/1 "2013-09-12T11:23:14Z")

</div>

Has anyone done anything with iCloud and Xojo, I’m designing a project at the moment and I want to use iCloud. So that the data can be synced between apps running on macs as well as the iPhone/iPad (when Xojo compiles iPhone/iPad).

My data is limited in relational, so I’m trying to decide if I should store all of it in a document and use document syncing or use Key/value storage? I do however have a concern about concurrency as I’d like to allow users to edit the data from all their devices, without concern about locking and such.

Is it hard to set-up?

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [September 12, 2013, 11:27am UTC](https://forum.xojo.com/t/icloud/10880/2 "2013-09-12T11:27:43Z")

</div>

We have iCloud support in our plugins.  
But I want to note that you need to put in a lot of work and your clients only can use it if they buy your app through Mac App Store.  
So if you plan to implement something for other clients, you may go directly with your own sync solution.

---

<div class="post-metadata">

**Author:** ![Mahyar\_Shariat](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@Mahyar\_Shariat](https://forum.xojo.com/u/Mahyar_Shariat)\
**Post date:** [September 12, 2013, 4:21pm UTC](https://forum.xojo.com/t/icloud/10880/3 "2013-09-12T16:21:43Z")

</div>

[quote=33098:@Sam Rowlands]Has anyone done anything with iCloud and Xojo, I’m designing a project at the moment and I want to use iCloud. So that the data can be synced between apps running on macs as well as the iPhone/iPad (when Xojo compiles iPhone/iPad).

My data is limited in relational, so I’m trying to decide if I should store all of it in a document and use document syncing or use Key/value storage? I do however have a concern about concurrency as I’d like to allow users to edit the data from all their devices, without concern about locking and such.

Is it hard to set-up?[/quote]  
As far as i know, for database syncing you’re going to need Core Data which is not supported by Xojo so far.

---

<div class="post-metadata">

**Author:** ![Koua\_Lo](https://forum.xojo.com/letter_avatar_proxy/v4/letter/k/a6a055/32.png) [@Koua\_Lo](https://forum.xojo.com/u/Koua_Lo)\
**Post date:** [September 12, 2013, 7:19pm UTC](https://forum.xojo.com/t/icloud/10880/4 "2013-09-12T19:19:52Z")

</div>

I looked into making this work using MBS about a year ago. It was painful with lots of hoops to run through. In the end, I was not able to make it work so I just gave up. The MBS plugin for iCloud was pretty new back then though (I tried it the week it was first announced). Perhaps Christian has improved on them since then.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [September 13, 2013, 1:51am UTC](https://forum.xojo.com/t/icloud/10880/5 "2013-09-13T01:51:15Z")

</div>

Hi Christian, I see that you have the functions in your plugin.

My questions may not be clear, but I’m more thinking about how best I can save my data to make it most compatible with iCloud. I intend to store all the user data on the machine, then basically use iCloud to synchronize the data.

I’ll keep reading the Apple docs, until something strikes me.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [September 13, 2013, 4:53am UTC](https://forum.xojo.com/t/icloud/10880/6 "2013-09-13T04:53:21Z")

</div>

How much data do you want to synchronize? How complex is the data? I think that for a smallish amount of simply structured data iCloud may make sense. For anything else read lots of fun blog entries of failing to do iCloud sync correctly. See

[Jumsoft](http://www.jumsoft.com/2013/01/response-to-sync-issues/)  
[Bare Bones](http://rms2.tumblr.com/post/46505165521/the-gathering-storm-our-travails-with-icloud-sync)  
[Ars Technica](http://arstechnica.com/apple/2013/03/frustrated-with-icloud-apples-developer-community-speaks-up-en-masse/)

HTH

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [September 13, 2013, 4:59am UTC](https://forum.xojo.com/t/icloud/10880/7 "2013-09-13T04:59:40Z")

</div>

It’s not very complex data, there just could potentially a lot of it, maybe 1000s of records (although I doubt seriously 10,000s).

While the project is in very early design stages, I was just trying to decide if I should use a single file or multiple files (which could work with Key/Value pairs).

I’ll do some more reading and perhaps if anyone else is interested I’ll write up what I’m find.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [September 13, 2013, 6:41am UTC](https://forum.xojo.com/t/icloud/10880/8 "2013-09-13T06:41:06Z")

</div>

Well, I did make a working example for my tests here a few weeks after I finished creating those classes. So Nona, if you tried in-between you may had trouble. Maybe you check current plugin examples again?

---

<div class="post-metadata">

**Author:** ![Koua\_Lo](https://forum.xojo.com/letter_avatar_proxy/v4/letter/k/a6a055/32.png) [@Koua\_Lo](https://forum.xojo.com/u/Koua_Lo)\
**Post date:** [September 13, 2013, 1:51pm UTC](https://forum.xojo.com/t/icloud/10880/9 "2013-09-13T13:51:53Z")

</div>

Christian, I will certainly give it another try in the next few days.

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [August 7, 2014, 8:19am UTC](https://forum.xojo.com/t/icloud/10880/10 "2014-08-07T08:19:39Z")

</div>

The current example is dated Jun 2014, and demands OSX10.7  
Yet it is in the Lion plugin.

Is there an example that still works with 10.6?  
And does anyone have any explanation of what the example does anywhere?

[code]query = new MyNSMetadataQueryMBS

```
			dim paths() as string
			paths.Append query.NSMetadataQueryUbiquitousDataScope
			'paths.Append query.NSMetadataQueryUbiquitousDocumentsScope
			query.setSearchScopes paths
			
			// dummy predicate to find all items
			dim args() as Variant
			args.Append NSMetadataItemMBS.NSMetadataItemFSNameKey
			dim pred as NSPredicateMBS = NSPredicateMBS.predicateWithFormat("%K LIKE '*'", args)[/code]

```

I am struggling to find out what a QueryUbiquitousDataScope is, for example.

To be honest, I was expecting something like

`dim f as folderitem
f = iCloudMBS.folderitem("hello.txt")`

or similar. Perhaps with some element of user id login?

Has anyone got this working ?

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [August 7, 2014, 10:37am UTC](https://forum.xojo.com/t/icloud/10880/11 "2014-08-07T10:37:20Z")

</div>

from Apple docs:

[quote]// -setSearchScopes: will throw an exception if the given array contains a mix of the scope constants below with constants above.  
FOUNDATION\_EXPORT NSString \* const NSMetadataQueryUbiquitousDocumentsScope NS\_AVAILABLE(10\_7, 5\_0); // “Documents” subdirectory in the application’s Ubiquity container  
FOUNDATION\_EXPORT NSString \* const NSMetadataQueryUbiquitousDataScope NS\_AVAILABLE(10\_7, 5\_0); // application’s Ubiquity container, excluding the “Documents” subdirectory[/quote]

so those constants are Mac OS X 10.7 only. Sorry.

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [August 7, 2014, 11:02am UTC](https://forum.xojo.com/t/icloud/10880/12 "2014-08-07T11:02:17Z")

</div>

Thanks for replying, Christian.

I assume those constants weren’t in the previous plugin version.  
And presumably if you don’t use them it would work on 10.6

No matter: I dont understand any of the above code so I’ll have to give it a miss.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [August 7, 2014, 11:22am UTC](https://forum.xojo.com/t/icloud/10880/13 "2014-08-07T11:22:26Z")

</div>

The constants are defined in the plugin, but they don’T return a value on 10.6.

You can of course try it, but Apple normally has a reason to say it’s 10.7+ only.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [August 7, 2014, 4:44pm UTC](https://forum.xojo.com/t/icloud/10880/14 "2014-08-07T16:44:43Z")

</div>

That would be because you can’t use iCloud with 10.6 - [Apple](http://store.apple.com/us/question/answers/product/MC573Z/A/does-osx-1068-have-icloud/QUHCDHCCXUXK2P9PH)

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 4:50pm UTC](https://forum.xojo.com/t/icloud/10880/15 "2020-10-29T16:50:48Z")

</div>


