Re: Get the name of the method that called a method

2009-04-21 Thread Alex Kac
WEll that's during debugging. I'm trying to log it during a beta tester run. I don't want it to crash, but just during some debugging with these testers I want to see what methods call it when in relation to other things happening. In our tests it should only happen in specific situations,

Re: Get the name of the method that called a method

2009-04-21 Thread Marcel Weiher
On Apr 20, 2009, at 23:09 , Alex Kac wrote: I am trying to log some specific error conditions in a fairly dynamic environment (of course Obj-C's forté), and would like to log some sort of backtrace of method calls that reached a specific method. What is the best way to get that info? This

Re: Get the name of the method that called a method

2009-04-21 Thread Ed Wynne
On Apr 21, 2009, at 11:27 AM, Alastair Houghton wrote: On 21 Apr 2009, at 15:59, Michael Ash wrote: On Tue, Apr 21, 2009 at 2:09 AM, Alex Kac wrote: I am trying to log some specific error conditions in a fairly dynamic environment (of course Obj-C's forté), and would like to log some sort

Re: Get the name of the method that called a method

2009-04-21 Thread Alastair Houghton
On 21 Apr 2009, at 15:59, Michael Ash wrote: On Tue, Apr 21, 2009 at 2:09 AM, Alex Kac wrote: I am trying to log some specific error conditions in a fairly dynamic environment (of course Obj-C's forté), and would like to log some sort of backtrace of method calls that reached a specific met

Re: Get the name of the method that called a method

2009-04-21 Thread Michael Ash
On Tue, Apr 21, 2009 at 2:09 AM, Alex Kac wrote: > I am trying to log some specific error conditions in a fairly dynamic > environment (of course Obj-C's forté), and would like to log some sort of > backtrace of method calls that reached a specific method. > > What is the best way to get that info

Re: Get the name of the method that called a method

2009-04-21 Thread Dave Keck
Hey, The first thing that comes to mind is throwing an exception, catching it, then accessing the NSException's -callStackReturnAddresses. From there, you'll need to turn the addresses into symbol names. I googled it a little bit and found these references: http://developer.apple.com/documentatio

Get the name of the method that called a method

2009-04-20 Thread Alex Kac
I am trying to log some specific error conditions in a fairly dynamic environment (of course Obj-C's forté), and would like to log some sort of backtrace of method calls that reached a specific method. What is the best way to get that info? This is using Objective-C 2.0 on the iPhone. Al