Hey guys, I am trying to get the path that an NSDocument is being saved to at save time. I tried overriding writeToURL
but that would pass me an obscure temp file URL, which was not where it was getting saved. Also asking the document like this [document fileURL]
only works after it has been saved. I can get the path when it is loaded but I need some way for that initial save. Is there a way I can get the real file path when an NSDocument is saved?
views:
32answers:
1
+1
A:
It would really help if you told us more about why you want this.
That said, the lowest level method with this information is -writeSafelyToURL:ofType:forSaveOperation:error:
Mike Abdullah
2010-10-16 23:26:02
Can I override this instead of writeToURL?
Justin Meiners
2010-10-17 02:22:11
Yes, hence why I mentioned it. Overriding `-saveToURL:ofType:forSaveOperation:error:` should do the job best I imagine.
Mike Abdullah
2010-10-17 13:48:40
@Mike Abdullah Ok thanks, sorry I was just making sure because I thought it might be something I would have to override in addition to it.
Justin Meiners
2010-10-17 20:49:11