Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removed view still getting events (Solved?)



I think I solved the problem. The view that was getting removed had registered itself to watch for NSWindowDidResizeNotification's. Even though tthat view stopped observing when it was deallocated, this notification was occurring during my windowDidLoad process of swapping out views (prior to its deallocation) and something in the called method did not like being called in this view (I am not sure exactly what - but it set up something in the window that caused a crash sometime down the road when the mouse entered the old view - see below).

By telling the old view to stop observing before swapping out views (and therefore before any NSWindowDidResizeNotification's), the problem has gone away.

Thanks for all the input. The comment to think about tracking rects was the key to the final answer. Now I can enjoy the weekend.

-----------

Here is what got called by NSWindowDidResizeNotification. If it was called just prior to swapping out the trackingRect had never been defined. Perhaps the addTrackingRect with the soon-to-be-removed as owner was the problem.

- (void)fixTrackingRect:(NSNotification *)notify
{
    if([notify object] == [self window])
    {	[self removeTrackingRect:trackingRect];
        trackingRect=[self addTrackingRect:[self visibleRect]
                        owner:self userData:0 assumeInside:NO];
    }
}

---------------
John Nairn (1-541-737-4265, FAX:1-541-737-3385)
Professor and Richardson Chair
Web Page: http://woodscience.oregonstate.edu/faculty/Nairn
FEA/MPM Web Page: http://oregonstate.edu/~nairnj



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Removed view still getting events (From: John Nairn <email@hidden>)
 >Re: Removed view still getting events (From: j o a r <email@hidden>)
 >Re: Removed view still getting events (From: John Nairn <email@hidden>)
 >Re: Removed view still getting events (From: John Nairn <email@hidden>)
 >Re: Removed view still getting events (From: j o a r <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.