Re: Weird crash in -[NSSearchField setRecentSearches:]
Re: Weird crash in -[NSSearchField setRecentSearches:]
- Subject: Re: Weird crash in -[NSSearchField setRecentSearches:]
- From: Lee Ann Rucker <email@hidden>
- Date: Mon, 10 Nov 2014 20:37:34 +0000
- Thread-topic: Weird crash in -[NSSearchField setRecentSearches:]
Do you implement any of the delegate methods corresponding to the notifications? Cocoa will add notifications for you instead of bothering with "respondsToSelector:" all the time.
On Nov 9, 2014, at 5:02 AM, Jerry Krinock <email@hidden> wrote:
>
>> On 2014 Nov 07, at 16:02, Greg Parker <email@hidden> wrote:
>>
>> You may have better luck tracing it from the other side. Run to that line in appendToRecentSearches:, set a breakpoint on -[NSNotificationCenter postNotificationName:object:userInfo:], and step over your line. At those breakpoints you should be able to see the notification parameters in the parameter registers, assuming the notification is sent every time that line runs.
>
> Great idea, Greg. It worked.
>
> It told me that that setting recent searches in this menu posts 122 notifications, 120 of which are due to building the search field’s popup menu.
>
> • 40 NSMenuDidAddItemNotification, one for each item in the search field’s popup menu
> • 20 NSMenuDidChangeItemNotification, which are mixed in with the above, for items that changed.
> • 1 NSUserDefaultsDidChangeNotification.
> • 1 NSAutosavedRecentsChangedNotification
> • 40 NSMenuDidAddItemNotification, same as before.
> • 20 NSMenuDidChangeItemNotification, same as before
>
> However, nowhere in *my* code do I directly create an observer of any of those four notification names. So I’m still head-scratching.
>
> If anyone has any idea what disappearing objects in AppKit might be observing these notifications, let us know.
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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://urldefense.proofpoint.com/v2/url?u=https-3A__lists.apple.com_mailman_options_cocoa-2Ddev_lrucker-2540vmware.com&d=AAIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=ie7S-J__EKnfyVOBV7-jV2rZ--p47O6vkyTklpDM3h4&m=w5agd-l-3BPhuNmONbQddSpn4HM9IRJjgW0KgxKNwVA&s=mDxqE8viH9vh4Nady5zh1nGUQ17-wAqL0xeem6VkpNg&e=
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden