• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Removed view still getting events (Solved?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removed view still getting events (Solved?)


  • Subject: Re: Removed view still getting events (Solved?)
  • From: John Nairn <email@hidden>
  • Date: Fri, 29 Sep 2006 13:58:20 -0700

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:
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>)

  • Prev by Date: NSScroller drawParts
  • Next by Date: Re: Strange issue with NSSplitView and NSTableView (bug ?)
  • Previous by thread: Re: Removed view still getting events
  • Next by thread: Re: Removed view still getting events
  • Index(es):
    • Date
    • Thread