Re: Using a document bundle file type with core data

2013-01-17 Thread Eric Gorr

On Jan 17, 2013, at 5:42 AM, Mike Abdullah  wrote:

> 
> On 17 Jan 2013, at 03:38, David Brittain  wrote:
> 
>> The code in this blog article enables saving core data files to a package:
>> 
>> http://cutecoder.org/featured/asynchronous-core-data-document/
>> 
>> Take a look at the writeSafelyToURL implementation in the gist at the
>> bottom. I haven't tried saving to a bundle myself, but found the
>> article helped me solve some problems with core data and documents.
> 
> The code in that article is a bit buggy. I did a rewrite, based off our 
> internal code here:
> 
> https://github.com/karelia/BSManagedDocument
> 
> Read through the header for full details, and make sure you work with the 
> ksmanageddocument branch for now. There are a lot of tricky edge cases 
> involved in this. About 4 years of discovering them has gone into this!

That is some great work. Thank you!
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Using a document bundle file type with core data

2013-01-17 Thread Mike Abdullah

On 17 Jan 2013, at 03:38, David Brittain  wrote:

> The code in this blog article enables saving core data files to a package:
> 
> http://cutecoder.org/featured/asynchronous-core-data-document/
> 
> Take a look at the writeSafelyToURL implementation in the gist at the
> bottom. I haven't tried saving to a bundle myself, but found the
> article helped me solve some problems with core data and documents.

The code in that article is a bit buggy. I did a rewrite, based off our 
internal code here:

https://github.com/karelia/BSManagedDocument

Read through the header for full details, and make sure you work with the 
ksmanageddocument branch for now. There are a lot of tricky edge cases involved 
in this. About 4 years of discovering them has gone into this!


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Using a document bundle file type with core data

2013-01-16 Thread Eric Gorr
Thank you! 

I will take a closer look at that soon. If you have a quick answer as to how I 
can have the -fileWrapperOfType:error: method be called, I would be interested.

On Jan 16, 2013, at 10:38 PM, David Brittain  wrote:

> The code in this blog article enables saving core data files to a package:
> 
> http://cutecoder.org/featured/asynchronous-core-data-document/
> 
> Take a look at the writeSafelyToURL implementation in the gist at the
> bottom. I haven't tried saving to a bundle myself, but found the
> article helped me solve some problems with core data and documents.
> 
> On Wed, Jan 16, 2013 at 7:25 PM, Eric Gorr  wrote:
>> I've got a sample project at:
>> 
>> http://ericgorr.net/cocoadev/docbundleCD.zip
>> 
>> Basically, what I am attempting to do should be fairly standard and simple, 
>> but I am apparently missing something obvious. I only want to be able to 
>> define my document type as a document bundle and place a Core Data file 
>> inside.
>> 
>> Clearly, my sample project is incomplete, but the start of any such project 
>> would require that the -fileWrapperOfType:error: method be called and it 
>> isn't despite the fact that I have set LSTypeIsPackage to YES for my 
>> document type - which is what I have done in the past for situations such as 
>> this, but they did not involve Core Data.
>> 
>> Any thoughts?
>> 
>> If there are any sample projects or tutorials, I would be interested as well.
>> 
>> Thank you.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Using a document bundle file type with core data

2013-01-16 Thread David Brittain
The code in this blog article enables saving core data files to a package:

http://cutecoder.org/featured/asynchronous-core-data-document/

Take a look at the writeSafelyToURL implementation in the gist at the
bottom. I haven't tried saving to a bundle myself, but found the
article helped me solve some problems with core data and documents.

Dave

On Wed, Jan 16, 2013 at 7:25 PM, Eric Gorr  wrote:
> I've got a sample project at:
>
> http://ericgorr.net/cocoadev/docbundleCD.zip
>
> Basically, what I am attempting to do should be fairly standard and simple, 
> but I am apparently missing something obvious. I only want to be able to 
> define my document type as a document bundle and place a Core Data file 
> inside.
>
> Clearly, my sample project is incomplete, but the start of any such project 
> would require that the -fileWrapperOfType:error: method be called and it 
> isn't despite the fact that I have set LSTypeIsPackage to YES for my document 
> type - which is what I have done in the past for situations such as this, but 
> they did not involve Core Data.
>
> Any thoughts?
>
> If there are any sample projects or tutorials, I would be interested as well.
>
> Thank you.
>
>
>
>
>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/websites%40paperetto.com
>
> This email sent to websi...@paperetto.com
>



-- 
David Brittain
da...@paperetto.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Using a document bundle file type with core data

2013-01-16 Thread Eric Gorr
I've got a sample project at:

http://ericgorr.net/cocoadev/docbundleCD.zip

Basically, what I am attempting to do should be fairly standard and simple, but 
I am apparently missing something obvious. I only want to be able to define my 
document type as a document bundle and place a Core Data file inside.

Clearly, my sample project is incomplete, but the start of any such project 
would require that the -fileWrapperOfType:error: method be called and it isn't 
despite the fact that I have set LSTypeIsPackage to YES for my document type - 
which is what I have done in the past for situations such as this, but they did 
not involve Core Data.

Any thoughts?

If there are any sample projects or tutorials, I would be interested as well.

Thank you.







___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com