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 7510167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:08:51+00:00 2026-05-29T23:08:51+00:00

Within a Mac OS X (10.7 Lion) Non-Document Based application, I want to include

  • 0

Within a Mac OS X (10.7 Lion) Non-Document Based application, I want to include iCloud support so I can share data across other instances of the same application on other macs (not to iOS devices). After surfing around the Apple documentation a bit, I’ve discovered I should use a key value list storage in iCloud, as the document I want to upload contains only an array of custom objects (that have simple properties such as a name (string), date (date object), …). This file is the only thing I want to upload to iCloud. Within the application, I have already implemented saving the file to the disk using NSFileManager‘s - (void)writeData:(NSData*)data toPath:(NSString *)path (or whatever it was, I’ve forgotten). It is loaded from the file using NSFileManager again (using - (NSData *)dataInFileAtPath:(NSString*)path, or whatever it was). The file is stored in a subdirectory, in the user’s Application Support directory. It is saved whenever a new item is added to the array, or an item in the array is modified.

I was wondering if anyone could provide a link to a tutorial, or point me in the right direction, to writing that file to iCloud, then downloading it again on other instances of the same application? All the tutorials and documentation I have found have only been for iOS. Any help will be greatly appreciated!

Thanks in Advance!

Ben

  • 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-05-29T23:08:53+00:00Added an answer on May 29, 2026 at 11:08 pm

    Just use NSUbiquitousKeyValueStore, which is a lot like NSUserDefaults except that it’s written to iCloud. You should read the iCloud Storage section of the Mac App Programming guide, but what you need to do may be as simple as enabling entitlements in the Summary tab of your App Target in Xcode, and then doing something like:

    NSData *dataToStore = [NSKeyedArchiver dataWithRootObject:yourArray];
    [[NSUbiquitousKeyValueStore defaultStore] setData:dataToStore forKey:@"yourKey"]; 
    

    Then, to retrieve your data, just do

    NSData *retrievedData = [[NSUbiquitousKeyValueStore defaultStore] dataForKey:@"yourKey"];
    NSArray *retrievedArray = [NSKeyedUnarchiver unarchiveObjectWithData:retrievedData];
    

    The one caveat here is that for this to work with an array of custom objects, these objects must all implement the NSCoding protocol. This is just a matter of implementing two methods; here’s a good tutorial.

    P.S. You use the same APIs whether you’re developing for OS X or iOS, so there’s no reason why you couldn’t just follow an iOS tutorial for iCloud storage.

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

Sidebar

Related Questions

I am having some troubles to use iCloud within my mac application. Following what
I am writing a Mac Cocoa application that will manipulate database files, which can
If someone installs my java application on their computer (windows/linux/mac), how can I make
When I try to terminate my GWT based web application from within Eclipse ,
I have Perl on Mac, Windows and Ubuntu. How can I tell from within
I have a Core-Plot Graph within a Mac Application. But the inside table is
I want to know can we install WP7 software on Mac machine. I found
Can anyone recommend an Application, preferably for Mac, that will capture pixel coordinates inside
Running: MAMP 2.0.5 PHP 5.3.6 (bundled with MAMP) Mac OS X Lion 10.7.2 My
Within my Mac app I've setup two NSSplitViews to create a Mail-style interface (with

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.