Re: Crash when move open document based app file to trash
Re: Crash when move open document based app file to trash
- Subject: Re: Crash when move open document based app file to trash
- From: Jonathan Mitchell <email@hidden>
- Date: Mon, 13 Apr 2015 15:39:59 +0100
> On 13 Apr 2015, at 15:01, Mike Abdullah <email@hidden> wrote:
>
> I think the document system monitors the file, and calls -setFileURL: when it detects a change.
Good catch there Mike!
-setFileURL: does indeed get called immediately the file gets renamed, moved or trashed,
I am not sure that my data layer can tolerate the mutation just yet but at least I am in on the action now.
Thanks a lot.
Jonathan
>
> I’m not sure how careful that monitoring is, though, whether it happens continuously, or only at the moment the app or document regains focus.
>
>> On 13 Apr 2015, at 14:19, Jonathan Mitchell <email@hidden> wrote:
>>
>> I have a Cocoa document app that represents a sqlite backed document type (its not CoreData).
>> Users can (and do) delete documents while they are open in the app.
>> The app then crashes in the sqlite data layer whenever data access occurs.
>> The data layer is Mono based, not Cocoa.
>>
>> I want to try and deal with this situation in a less dramatic way than a crash.
>>
>> TextEdit.app can detect when an open file moves to the trash and throws up a popover - though I cannot trace this down in the example source.
>>
>> I know about the existence of NSFileImmutable but is that the route to take?
>>
>> Any input would be a help.
>>
>> Thanks
>>
>> Jonathan
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>>
>> 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