Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-18 Thread Kevin Perry
On Sep 18, 2013, at 6:53 AM, Brian Clark wrote: > A follow-up as a result of more testing. > > It's not actually necessary to do the read via > -revertToContentsOfURL:ofType:error: in a "File Access" block to solve the > problem I had, though I'm sure it's best to do so (and that's what I now

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-18 Thread Brian Clark
A follow-up as a result of more testing. It's not actually necessary to do the read via -revertToContentsOfURL:ofType:error: in a "File Access" block to solve the problem I had, though I'm sure it's best to do so (and that's what I now do). Similarly moving the file to the Trash or deleting it

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Brian Clark
On Sep 16, 2013, at 12:24 PM, Kevin Perry wrote: > Re-using a single NSDocument instance to represent several different files is > certainly atypical… True, and I don't know what other similar applications so, but for some applications that are viewers it makes sense to let the user move forw

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Kevin Perry
Re-using a single NSDocument instance to represent several different files is certainly atypical… But, I suspect the problem here is that you're not using File Coordination when reading in the contents of the new file. By not doing that, you're not giving File Coordination the hint that it need

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Kyle Sluder
On Sat, Sep 14, 2013, at 01:14 PM, Brian Clark wrote: > I'm hoping someone can suggest the correct way to deal with the following > problem. > > For an image viewing app i display a file in the usual way in an > NSDocument. setFileURL: is properly called by NSDocument's > _initWithContentsOfURL:of

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Brian Clark
On Sep 16, 2013, at 4:38 AM, Mike Abdullah wrote: > > On 14 Sep 2013, at 21:14, Brian Clark wrote: > >> I'm hoping someone can suggest the correct way to deal with the following >> problem. >> >> For an image viewing app i display a file in the usual way in an NSDocument. >> setFileURL: is

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Mike Abdullah
On 14 Sep 2013, at 21:14, Brian Clark wrote: > I'm hoping someone can suggest the correct way to deal with the following > problem. > > For an image viewing app i display a file in the usual way in an NSDocument. > setFileURL: is properly called by NSDocument's > _initWithContentsOfURL:ofTyp

Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Brian Clark
I'm hoping someone can suggest the correct way to deal with the following problem. For an image viewing app i display a file in the usual way in an NSDocument. setFileURL: is properly called by NSDocument's _initWithContentsOfURL:ofType:error:. I now want to display the next file in the folder