Re: NSDocument fileURL

2014-01-23 Thread Graham Cox
On 24 Jan 2014, at 8:12 am, Pax <45rpmli...@googlemail.com> wrote: > Later (in windowControllerDidLoadNib), I try to get the file path - but I > turn up a blank (it returns null): > > NSLog(@"%@",[self fileURL]); > > Very strange. And yet the file does get processed correctly - it's just that

NSDocument fileURL

2014-01-23 Thread Pax
Hopefully this is a nice, easy, problem for you to ponder on a Thursday evening. I'm opening a document as follows: - (BOOL)readFromData:(NSData *)pData ofType:(NSString *)pTypeName error:(NSError **)pOutError { if ([pTypeName compare:@"CPro"] == NSOrderedSam

Re: -[NSDocument fileURL] is observable (KVO). Documented?

2010-06-02 Thread Jerry Krinock
On 2010 Jun 02, at 02:15, Mike Abdullah wrote: > er, I meant just override -setFileURL: to post a notification. But that doesn't solve the possibility of some future OS release changing fileURL in a non-KVO-compliant manner when another process changes the path of this document. Not likely, I

Re: -[NSDocument fileURL] is observable (KVO). Documented?

2010-06-02 Thread Mike Abdullah
On 1 Jun 2010, at 23:25, Jerry Krinock wrote: > > On 2010 Jun 01, at 15:07, Mike Abdullah wrote: > >> I'd advise subclassing to add your own notification posting code. > > Yuck. Unless someone knows a better way, that means setting up either a > kqueue or FSEvents thingy for the document to

Re: -[NSDocument fileURL] is observable (KVO). Documented?

2010-06-01 Thread Scott Anguish
alling -setFileURL: you will get proper notifications. > > On 1 Jun 2010, at 22:02, Jerry Krinock wrote: > >> There is no mention in -[NSDocument fileURL] documentation, nor in 10.5 or >> 10.6 release notes, that this property is observable using KVO. But when I >> added some co

Re: -[NSDocument fileURL] is observable (KVO). Documented?

2010-06-01 Thread Quincey Morris
On Jun 1, 2010, at 15:25, Jerry Krinock wrote: > Yuck. Unless someone knows a better way, that means setting up either a > kqueue or FSEvents thingy for the document to watch its own path. Does > anyone know an easier way? Because of the way that a document window's title > changes instantly

Re: -[NSDocument fileURL] is observable (KVO). Documented?

2010-06-01 Thread Jerry Krinock
On 2010 Jun 01, at 15:07, Mike Abdullah wrote: > I'd advise subclassing to add your own notification posting code. Yuck. Unless someone knows a better way, that means setting up either a kqueue or FSEvents thingy for the document to watch its own path. Does anyone know an easier way? Becaus

Re: -[NSDocument fileURL] is observable (KVO). Documented?

2010-06-01 Thread Mike Abdullah
will get proper notifications. >> >> On 1 Jun 2010, at 22:02, Jerry Krinock wrote: >> >>> There is no mention in -[NSDocument fileURL] documentation, nor in 10.5 or >>> 10.6 release notes, that this property is observable using KVO. But when I >>> adde

Re: -[NSDocument fileURL] is observable (KVO). Documented?

2010-06-01 Thread Kyle Sluder
default Cocoa classes use automatic KVO. So long as Cocoa always changes > the URL by calling -setFileURL: you will get proper notifications. > > On 1 Jun 2010, at 22:02, Jerry Krinock wrote: > >> There is no mention in -[NSDocument fileURL] documentation, nor in 10.5 or >&g

Re: -[NSDocument fileURL] is observable (KVO). Documented?

2010-06-01 Thread Kyle Sluder
On Tue, Jun 1, 2010 at 2:15 PM, Mike Abdullah wrote: > By default Cocoa classes use automatic KVO. So long as Cocoa always changes > the URL by calling -setFileURL: you will get proper notifications. This is certainly not the case for a great deal of Cocoa classes, particularly those which wrap

Re: -[NSDocument fileURL] is observable (KVO). Documented?

2010-06-01 Thread Mike Abdullah
By default Cocoa classes use automatic KVO. So long as Cocoa always changes the URL by calling -setFileURL: you will get proper notifications. On 1 Jun 2010, at 22:02, Jerry Krinock wrote: > There is no mention in -[NSDocument fileURL] documentation, nor in 10.5 or > 10.6 release notes

-[NSDocument fileURL] is observable (KVO). Documented?

2010-06-01 Thread Jerry Krinock
There is no mention in -[NSDocument fileURL] documentation, nor in 10.5 or 10.6 release notes, that this property is observable using KVO. But when I added some code to do this, created a document, and renamed the document in Finder while the document was open, my observer logged a hit. Is