I filed this myself some time ago, and my report was marked as a duplicate of 
rdar://19790930 . 

I worked around this crasher by swizzling 
-[NSDocumentTitlebarPopoverViewController invalidate] with something like this:

- (void) invalidate
{
        // This is essentially [self valueForKey:@"view"] but without calling 
the -view accessor method, to avoid potential (re)loading
        Ivar viewIvar = class_getInstanceVariable( [NSViewController class], 
"view" );
        if( NULL != viewIvar ) {
                ptrdiff_t viewIvarOffset = ivar_getOffset(viewIvar);
                NSView** viewPtr = (void*)self + viewIvarOffset;
                NSView* myView = *viewPtr;
                
                // if the view's delegate is the receiver, set it to nil to 
clear it
                id delegate = [myView 
performSelectorIfResponds:@selector(delegate)];
                if( self == delegate ) {
                        [myView 
performSelectorIfResponds:@selector(setDelegate:) withObject:nil];
                }
        }
        
        // call super's original method implementation
        NSDocumentTitlebarPopoverViewController_invalidateImp(self, _cmd); 
}

@end


I hope that helps,

~Martin Wierschin


>>> After enabling Zombie Objects, I get the following in the console:
>>> 2015-05-28 14:19:58.291 MyApp[23684:2561441] *** 
>>> -[NSDocumentTitlebarPopoverViewController isKindOfClass:]: message sent to 
>>> deallocated instance 0x600000146f60

>> We saw the same issue starting with 10.10.3 and continuing through current 
>> 10.10.4 builds. Write up a radar and reference radar://problem/20368338 as a 
>> duplicate instance.

> Good to know. Duplicate radar filed, rdar://problem/21145343.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to