Some days later, the tedium of cutting down a massive project is finally rewarded. The code was using a method of opening a document that perhaps is no longer supported?
// problem somehow associated with this line of code
// maybe the GPU is not cleaned out properly???
[self openNewDocumentIfNeeded];
Once that line was commented out, the problem went away.
In case one might spend more time wondering why .... ?
... then here is the offending code segment
// this code segment is from https://stackoverflow.com/questions/7564290/why-isnt-applicationshouldopenuntitledfile-being-called
(void) openNewDocumentIfNeeded {
// Get the recent documents
NSDocumentController * controller = [NSDocumentController sharedDocumentController];
NSArray * documents = [controller recentDocumentURLs];
// how many documents are in the recent list
// .. the most recent document added is at the bottom of the list
// ... but somehow I've noticed that the order of documents in the list can change
int nRecents = (int)[documents count];
// If there is a recent document, try to open it.
if ( nRecents > 0 ) {
NSError * error = nil;
NSURL * url = [documents objectAtIndex:(nRecents-1)];
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:url display:YES completionHandler:(void (^)(NSDocument * document, BOOL documentWasAlreadyOpen, NSError * error ) ) ^{
;
}];
// If there was no error, then prevent untitled from appearing.
if ( error == nil ) {
if ( nRecents > 0 ) {
return;
}
}
}
// Open an untitled document what if there is no document. (restored, opened).
if ( nRecents == 0 ){
[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error: nil];
}
}
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: