• 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: Xcode/gdb and Objective-C runtime errors/warnings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode/gdb and Objective-C runtime errors/warnings


  • Subject: Re: Xcode/gdb and Objective-C runtime errors/warnings
  • From: Tommy Nordgren <email@hidden>
  • Date: Sun, 19 Aug 2007 12:25:41 +0200


On 19 aug 2007, at 05.22, Phil wrote:

Perfect!  It did exactly what I was looking for.

Thanks,
Phil

There is another trick you might also find useful:
If the method in question is not defined in NSObject, then you can add it to NSObject
via a category.
In the method write this first:
-(float) floatValue
{
#ifdef DEBUG
Debugger(); /* Will break into gdb */
#endif
after this code, you can add code to throw an exception if you want to.
Note that you will need to link against the Carbon framework for this to work.
On Aug 18, 2007, at 10:27 PM, Clark Cox wrote:

If you set breakpoints at: "-[NSException raise]" and
"objc_exception_throw", the debugger should stop when any such
exception is raised.

On 8/18/07, Phil <email@hidden> wrote:
I've introduced a problem somewhere in my code but am having a bit of
trouble tracking it down so I was wondering: is it possible to have
Obj-C runtime errors/warnings drop me into the debugger at the
offending code? In my case, I'm attempting to call [NSNull
floatValue] which of course won't work and results in
an ...unrecognized selector sent to... message. Is there a flag that
would treat this as an error and drop me into the debugger when this
happens?

-- Clark S. Cox III email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40comhem.se


This email sent to email@hidden

-----------------------------------------------------
An astronomer to a colleague:
-I can't understsnad how you can go to the brothel as often as you do. Not only is it a filthy habit, but it must cost a lot of money too.
-Thats no problem. I've got a big government grant for the study of black holes.
Tommy Nordgren
email@hidden




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Xcode/gdb and Objective-C runtime errors/warnings (From: Phil <email@hidden>)
 >Re: Xcode/gdb and Objective-C runtime errors/warnings (From: "Clark Cox" <email@hidden>)
 >Re: Xcode/gdb and Objective-C runtime errors/warnings (From: Phil <email@hidden>)

  • Prev by Date: Re: Xcode/gdb and Objective-C runtime errors/warnings
  • Next by Date: Re: Build All configuration
  • Previous by thread: Re: Xcode/gdb and Objective-C runtime errors/warnings
  • Next by thread: dyld: Library not loaded
  • Index(es):
    • Date
    • Thread