• 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: Debugger calling string methods on a window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugger calling string methods on a window


  • Subject: Re: Debugger calling string methods on a window
  • From: Mike Ferris <email@hidden>
  • Date: Sun, 20 Jun 2004 12:08:07 -0700

Always remember the most common answer to the question "Why the hell is someone send an NSString method to a <WhateverClass> instance?"

The most common answer is that your WhateverClass instance (an NSWindow in this case) is at the same memory location that used to hold an NSString which was deallocated, but someone else still has a dangling pointer to the string and is trying to send it string messages.

These kinds of bugs are tricky (like many memory-related bugs) since you only hear about it (potentially a long time) after it actually went wrong. Try breaking on main() and setting NSZombieEnabled to YES before continuing. See NSDebug.h for more details, but zombies can be a big help tracking down dangling pointers...

Mike
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Debugger calling string methods on a window (From: Jonathan Jackel <email@hidden>)
 >Re: Debugger calling string methods on a window (From: j o a r <email@hidden>)

  • Prev by Date: Re: Where's the NSWindowController in a default document-based app
  • Next by Date: Re: iChat plug-ins?
  • Previous by thread: Re: Debugger calling string methods on a window
  • Next by thread: Re: Debugger calling string methods on a window
  • Index(es):
    • Date
    • Thread