Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9254473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:28:41+00:00 2026-06-18T11:28:41+00:00

I have a quite simple shoebox-style iOS app with 1 single Core Data database

  • 0

I have a quite simple shoebox-style iOS app with 1 single Core Data database (as a UIManagedDocument) and thought about trying to add iCloud support.


I of course have to check if there is already an existing database in the cloud *before creating a new UIManagedDocument at startup*, saving/opening it, etc.

As i already know the filename and that there’s either 1 document or no document at all, I didn’t really get if I had to

  1. start a NSMetaDataQuery with a predicate for the exact filename
    and then get the fileURL from the result (and download it
    explicitly?) and open it if there is one, or

  2. just use [[NSFileManager defaultManager] fileExistsAtPath:self.iCloudDBURL]
    with iCloudDBURL created from URLForUbiquityContainerIdentifier + appending ? Is this URL only a local one and doesn’t check the “real” cloud automatically?


I know the use of UIManagedDocument might not be the “right” way for this kind of app, but I thought it’d easier and I could try..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:28:43+00:00Added an answer on June 18, 2026 at 11:28 am

    You need to use the NSMetadataQuery approach.

    When using iOS on iCloud, documents don’t download automatically– they only download when you ask for them. Using NSFileManager as you suggest would only tell you if the file existed on the local device. But, the file might exist up in the cloud, not downloaded locally yet. If you use NSMetadataQuery you can find out if the document exists anywhere, even if it’s in the cloud and not actually downloaded yet. You can find out about the document if it was created on a different device. This also covers the case where the user deletes and reinstalls the app, but doesn’t delete cloud data– you find out if it exists even though it’s not downloaded.

    Since you’re using UIManagedDocument you shouldn’t need to make a specific download call– it will handle that for you when you open it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a android app that is quite simple it fetches data from the
I have a quite simple data capture web app. In the main capture window,
I'm new to WCF data services. I have a quite simple data model. Some
I have a quite simple question about memory management in Objective-c and methods calling.
I am trying to accomplish something quite simple, yet I have found no good
I have the following quite simple test PHP code that extracts the data and
I'm trying to achieve something that seems quite simple but I have hard time
I have a quite simple database query: Query q = new Query(person); q.addFilter(name, Query.FilterOperator.EQUAL,
I have an quite simple query SELECT id FROM table where ID in &data
my question is quite simple : does google have an in app purchase service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.