Race Condition when Moving NSDocuments to iCloud

**Update:** I just re-read a cocoa-dev post from last month in which Kevin Perry from Apple states the following: > I don't see the nested uses of performSynchronousFileAccessUsingBlock: you mentioned in that code, but that's not a problem anyway, since file access is recursive, as long as it happens synchronously within the outer-most file access block (a fact that admittedly may not be documented well anywhere). That would certainly change things. Perhaps the reason that -relinquishPresentedItemToWriter: was deadlocking on me is because it calls -performActivityWithSynchronousWaiting:, not just -performSynchronousFileAccess? I'll have to experiment. * * * **Now that iCloud** is out, I can finally talk about this in a public forum. Unfortunately, the cocoa-dev mailing list is down. But I really need to get this question out there, or at least written down, because it involves one of the most confusing new APIs in Lion: -[NSDocument performSynchronousFileAccess:] (or -performAsynchronousFileAccess: if you really hate your sanity).

NSWindowController and -[NSWindow isReleasedWhenClosed]

I noticed that the Resource Programming Guide has been updated for ARC, which prompted me to investigate something that has puzzled me for a long time: how does NSWindowController interact with NSWindow's "convenience" method -isReleasedWhenClosed? It turns out that NSWindowController actually calls -setReleasedWhenClosed:NO on its window as part of -setWindow:. It doesn't matter if NSWindowController … Continue reading NSWindowController and -[NSWindow isReleasedWhenClosed]