Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7547067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:21:31+00:00 2026-05-30T09:21:31+00:00

The golden rule of using NSNotification seems to be call removeObserver before the observer

  • 0

The golden rule of using NSNotification seems to be

“call removeObserver before the observer (or the object) is deallocated”.

I’m dealing with a codebase where this rule hasn’t been followed, but I can’t locate the transgression. I’ve searched through the code and ensured that every addObserver has a matching removeObserver but I’m still seeing crash reports of the following variety:

OS Version:      iPhone OS 5.0.1 (9A405)
Report Version:  104

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x8
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                     0x31516fbc objc_msgSend + 16
1   Foundation                          0x3195b50f __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 19
2   CoreFoundation                      0x37a02577 ___CFXNotificationPost_block_invoke_0 + 71
3   CoreFoundation                      0x3798e0cf _CFXNotificationPost + 1407
4   Foundation                          0x318cf3fb -[NSNotificationCenter postNotificationName:object:userInfo:] + 67
5   UIKit                               0x34e5ee25 -[UIApplication _handleApplicationSuspend:eventInfo:] + 697
6   UIKit                               0x34deed17 -[UIApplication handleEvent:withNewEvent:] + 2031
7   UIKit                               0x34dee3bf -[UIApplication sendEvent:] + 55
8   UIKit                               0x34dedd2d _UIApplicationHandleEvent + 5809
9   GraphicsServices                    0x3750bdf3 PurpleEventCallback + 883
10  CoreFoundation                      0x37a0a553 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 39
11  CoreFoundation                      0x37a0a4f5 __CFRunLoopDoSource1 + 141
12  CoreFoundation                      0x37a09343 __CFRunLoopRun + 1371
13  CoreFoundation                      0x3798c4dd CFRunLoopRunSpecific + 301
14  CoreFoundation                      0x3798c3a5 CFRunLoopRunInMode + 105
15  GraphicsServices                    0x3750afcd GSEventRunModal + 157
16  UIKit                               0x34e1c743 UIApplicationMain + 1091
17  App                                 0x00002d2f main (main.m:14)

My interpretation of this crash report is that [UIApplication _handleApplicationSuspend:eventInfo:] is posting a notification for which an observer has been deallocated before being removed.

Assuming this interpretations is correct, how would I go about determining which notification is being posted? And ideally, what the deallocated object type?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:21:32+00:00Added an answer on May 30, 2026 at 9:21 am

    You can set a symbolic breakpoint in -[NSNotificationCenter postNotificationName:object:userInfo:] and print the third argument passed to it (the first being the NSNotificationCenter, the second, _cmd) using the debugger po command.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Performance Golden Rule from Yahoo's performance best practices is: 80-90% of the end-user
If I have a structure like this: <ul> <li class=golden-delicious>Golden Delicious</li> <li class=mutsu>Mutsu</li> <li
When using boost::scoped_ptr to hold a reference, the destructor of the derived object is
I'm trying to read the access for files and directories in Windows using this
I know this thread existed before , but was closed as only appearing in
Here is my code: This is the function being called by fiddler using: http://localhost:3334/Service/Login/?json={'username':'cara','password':'password'}
I was using the rebasing topic branches workflow http://www.golden-gryphon.com/software/misc/packaging.html But because the local testers
The Verilog Golden Reference Guide on page 12 warns against unsynthesisable always blocks, and
I need to create lines like this: <li data-target=c1.html><span>I. </span><span>Het tijdperk der goden</span></li> I
I was looking at the Golden Ratio formula for finding the nth Fibonacci number,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.