Re: iCloud On OSX - Cannot save changes (Resolved?)
Re: iCloud On OSX - Cannot save changes (Resolved?)
- Subject: Re: iCloud On OSX - Cannot save changes (Resolved?)
- From: April <email@hidden>
- Date: Wed, 01 Feb 2012 16:42:17 -0700
Ok a little info
I "discovered" the WWDC video on NSFileCoordinators etc...
I watched it front to back
Took notes
It helped a little.
What helped more than anything though was the suggestion I check the console app. I found a message there about a sandbox block on my app.
I picked bit by bit through the message.
The chain of events was fairly obvious.
I used the info I learned in the video to overcome the problem. Autosave with iCloud now works, I assume, as intended.
I over rode the saveToURL: method that failed, and used the filecoordinator to fix it all.
April.
On Jan 31, 2012, at 10:57 PM, April wrote:
> Ok that's the problem right there I know for sure. The filecoordinator methods. No they are not wrapped. And nothing else is overridden in my NSDocument subclass.
> I read about needing to use the NSFileCoordinator but could not find information on how, where, what exactly needed to be done... Just the half paragraph, you need this too stuff in the documentation that more or less tell you absolutely nothing you didn't already know. I honestly want this to be done by the book, but I'm having the worst time finding the book to do it by.
>
> April.
>
> On Jan 31, 2012, at 8:21 AM, April wrote:
>
>> Thanks a lot for the reply.
>> When it is not using iCloud everything works like a dream. It all functions exactly as expected. I only get the permission error with autosave and iCloud. I have reached a point where if I use writeSafely: etc... it will save to iCloud, but I cannot use autosave, I have to set up a timer to fire every x seconds and save if there are changes.
>>
>>
>> April.
>>
>> On Jan 30, 2012, at 11:41 PM, Michael Swan wrote:
>>
>>> April,
>>> You should try saving a non-iCloud document and see if you still have issues. If so try going through a couple of Apple's basic Mac OS X tutorials to see if they fill in the holes for you. If you are working with Core Data you can check out some tutorials I've written for a document based Care Data app at http://www.theMikeSwan.com/blog. I plan to do an iCloud tutorial as soon as I have the time. I also have some basic classes for iCloud on GitHub that are in TMSSupportClasses. There is a bug in 10.7.2 where if you have the same document open on more than one machine and save changes to it on one of the machines that others will lose the ability to save to the file until you close it and re-open it on the machine you want to save from.
>>> Also, if you have iCloud problems that are generating log messages (they may be hiding in Console.app) about your app doing something that isn't allowed switch to Finder and navigate to ~/Library/Containers and delete the folder with your app bundle ID. Some times the container gets messed up and needs to be re-done.
>>>
>>> Good luck,
>>> Mike Swan
>>> ETCP Certified Entertainment Electrician
>>> http://www.theMikeSwan.com
>>>
>>> <pastedGraphic.tiff>
>>>
>>> On 30 Jan, 2012, at 11:15 AM, email@hidden wrote:
>>>
>>>> Message: 9
>>>> Date: Sun, 29 Jan 2012 23:26:41 -0700
>>>> From: April <email@hidden>
>>>> To: list-cocoa-dev <email@hidden>
>>>> Subject: iCloud On OSX - Cannot save changes
>>>> Message-ID: <email@hidden>
>>>> Content-Type: text/plain; charset=us-ascii
>>>>
>>>> On iOS iCloud is easy.
>>>> On OSX I don't know what the problem is.
>>>>
>>>> Ok.. First I had a document on my computer. The using the setUbiquidous method I moved it to iCloud.
>>>> It is on iCloud, and readable. But thats the problem. I have read only access to it from the Mac App.
>>>>
>>>> When I open the document I use :
>>>>
>>>> self.document = [[NTPDocument alloc]initWithContentsOfURL:iCloudURL ofType:@"MyDataType" error:&err];
>>>>
>>>> NTPDocument is my subclass of NSDocument. and only implements the dataOfType and readFromData. It also returns YES for autosaves in place.
>>>>
>>>> And that's hitch #1.
>>>>
>>>> When It attempts to autosave I get an error window in the app that it could not auto save the document because I do not have permission.
>>>>
>>>> When I try the saveToURL:ofType:forSaveOperation:completionHandler: I get an "Unimplemented core routine" error (code -4) I have absolutely no clue what this means and cannot for the life of me find the information in the documentation on how to open the file for read/write access. I cannot find a flag or entitlement anywhere that I am missing for allowing me to write to the icloud document...
>>>>
>>>> I have attempted to just use [self.document saveDocument:nil] out of desperation but nothing saves, and no error.
>>>>
>>>> The main thing being that no matter what way I try to save, my document is never asked to encode the document data.
>>>>
>>>> I'm at a loss... Is there possibly an example of working code? Or some part of the documentation that I've not found? I foolishly thought this would be a simple matter of porting my iOS code...
>>>>
>>>> If some one has gotten iCloud working for them could you please help?
>>>>
>>>> April.
>>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden