Re: FileWrapper & iCloud
Re: FileWrapper & iCloud
- Subject: Re: FileWrapper & iCloud
- From: Mike Abdullah <email@hidden>
- Date: Sat, 01 Dec 2012 22:12:37 +0000
On 1 Dec 2012, at 20:12, Dave Fernandes wrote:
>
> On 2012-12-01, at 11:42 AM, Mike Abdullah <email@hidden> wrote:
>>>>>> One way to look at it is that NSPersistentDocument pretty much painted itself into a corner from day 1, and it's too messy for Apple to untangle that.
>>>>>
>>>>> Can you elaborate?
>>>>
>>>> Well it makes the assumptions that your document:
>>>>
>>>> - is comprised of a single Core Data store
>>>> - has a single managed object context
>>>
>>> This definitely limits your options. But, is it necessary to support file wrappers and iCloud? (Just trying to educate myself about how documents work.)
>>
>> I don't understand your question here. Are you asking if my list of assumptions are necessary conditions for iCloud and file wrapper support?
>
> Yes, that was basically the question. For example, what if you were just using file wrappers to store images outside the persistent store.
My understanding is that if you want anything to be persisted outside of Core Data, you get treated just like a regular NSDocument subclass. i.e. no attempt to sync by SQLite changes.
On OS X the docs state that NSPersistentDocument is flat-out not supported for iCloud.
On iOS, the docs state that UIManagedDocument does not support additional content when used for iCloud. I assume the reason is that the moment you add into the mix some data outside of Core Data’s control/knowledge, iCloud has no smart way to sync it, so you’re giving up that major benefit of Core Data. Of course Core Data supports externally stored data attributes these days, so that does improve the situation.
At that point I figure it’s best and easiest to subclass NSDocument afresh to add Core Data support, rather than try to bend NSPersistentDocument to your bidding. This is what I have done with BSManagedDocument.
> I believe, the window controller and view objects are always created on the main thread after the MOC has been initialized, so there won't be any contention with trying to access the MOC from different threads at the same time.
Correct. The UI doesn’t get created until -makeWindowControllers is called, which happens on the main thread and is a standard feature of the document architecture.
_______________________________________________
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