How to get the name of a method at runtime?

2008-03-09 Thread Stuart Malin
I'd like to have a method determine the name of the method that invoked it -- as an NSString. For example - (void) method1 { [someObject method2]; } - (void) method2 { // here, I'd like to be able to find the name of the caller // in this example, that would be

Re: ShortWeekNames

2008-03-09 Thread Alexander Griekspoor
Must have been late yesterday, I tried that then but it gave nothing, this morning my Mac was more friendly and it works perfect. Thanks! Alex On 9 mrt 2008, at 04:27, Nick Zitzmann wrote: On Mar 8, 2008, at 6:01 PM, Alexander Griekspoor wrote: what is now the blessed way of obtaining the

Re: NSUserDefaults and mutability

2008-03-09 Thread Trygve Inda
On 8 Mar '08, at 1:57 PM, Trygve Inda wrote: Is this expected? Can I rely on it? I will never need to change dict, but I am modifying items within a known sub Dictionary. Don't rely on this; it's entirely possible this behavior could change in the future, causing your app to throw an

How to get this bundle with identifier

2008-03-09 Thread Nick Rogers
Hi, In my app I need to get the icon for my HDD. For this I need to get the bundle with identifier com.apple.iokit.IOStorageFamily. How can i get this bundle? Any help would be greatly appreciated. Wishes, Nick ___ Cocoa-dev mailing list

Re: How to get this bundle with identifier

2008-03-09 Thread Ricky Sharp
On Mar 9, 2008, at 6:48 AM, Nick Rogers wrote: In my app I need to get the icon for my HDD. For this I need to get the bundle with identifier com.apple.iokit.IOStorageFamily. How can i get this bundle? Any help would be greatly appreciated. Please do at least some minimal searching.

Re: How to get this bundle with identifier

2008-03-09 Thread Stéphane Sudre
On Mar 9, 2008, at 12:48 PM, Nick Rogers wrote: Hi, In my app I need to get the icon for my HDD. For this I need to get the bundle with identifier com.apple.iokit.IOStorageFamily. How can i get this bundle? Since this kernel extension won't probably change its name and location:

Detecting resolution changes?

2008-03-09 Thread [EMAIL PROTECTED]
I want to detect when a screen's resolution has changed, so I can resize and re-center my main window. Does NSWindowDidChangeScreenProfileNotification do what i want? If the user moves the window (into a differently-sized widow, causing a change), it looks like I could trap/check at

Re: NSUserDefaults and mutability

2008-03-09 Thread Trygve Inda
Is it enough then to take the dictionary I get back and do a [dict mutableCopy]? Will this cascade down to the subdicts (dicts within the top level dict). No it won't. mutableCopy only operates on one particular object and not all its contained objects. While that behavior does

Re: How to get the name of a method at runtime?

2008-03-09 Thread Jonathan Dann
I think maybe you missed the existence of _cmd. Both self (this object) and _cmd (this selector) are passed as implicit arguments to every Objective-C method. You can also call __func__ from within a method call, I use this often, NSLog(@%p %s,self,__func__); // Thanks James Bucanek Jon

Re: Determining why outline view column editing cancels for no apparent reason

2008-03-09 Thread Nick Zitzmann
On Mar 9, 2008, at 10:12 AM, Doug Knowles wrote: I'd like to set a breakpoint on the outline view or the field to see what's causing the cancellation, but I can't find a good candidate. Any debugging suggestions? I'd suggest trying -resignFirstResponder on NSTextView and its

Parent/Child initialization with NSTreeController

2008-03-09 Thread tim lindner
I need more control when the user creates objects in my application. I'm using an NSTreeController with CoreData (via Bindings). I have a parent object that does double duty as a child object thru parent and child relationships. Parent and child objects need to be initialized diferently. Parent

Re: Determining why outline view column editing cancels for no apparent reason

2008-03-09 Thread Doug Knowles
Blindingly obvious, now that I've seen the light. Found the problem. Thanks, Nick, for taking the moment to help me out. Doug K; On Sun, Mar 9, 2008 at 1:15 PM, Nick Zitzmann [EMAIL PROTECTED] wrote: On Mar 9, 2008, at 10:12 AM, Doug Knowles wrote: I'd like to set a breakpoint on the

Re: No parent window for sheets?

2008-03-09 Thread Paul Kim
Hi Jim, Maybe I should just send my queries directly to you in the future since you always seem to be the one answering :) I think traversing the window list is not worth it for what I am doing (it'll be on my blog soon). While the definition for -isSheet is somewhat odd, I think it

Re: how to get a particular icon from .icns file

2008-03-09 Thread Michael Watson
if you look at the count of representations of that NSImage, you will find several sizes. (Assuming, of course, that the original .icns file contained multiple representations of different sizes.) -- m-s On 09 Mar, 2008, at 09:28, Nick Rogers wrote: Hi, I have a icon file (.icns) with 10

Re: NSUserDefaults and mutability

2008-03-09 Thread Ken Thomases
On Mar 9, 2008, at 10:50 AM, Trygve Inda wrote: In Carbon I could do: CFPropertyListCreateDeepCopy (kCFAllocatorDefault, localDict, kCFPropertyListMutableContainersAndLeaves); Is there a NSDictionary way to do this? The above. An NSDictionary is toll-free bridged to CFDictionaryRef, so

Re: How to get the name of a method at runtime?

2008-03-09 Thread stephen joseph butler
On Sun, Mar 9, 2008 at 4:45 PM, Tony Becker [EMAIL PROTECTED] wrote: If you're on Leopard, there is a new backtrace(3) call. If you're on Tiger, it's a little more complex... You can use the compiler function (long)__builtin_return_address(0) to find the

Re: How to get the name of a method at runtime?

2008-03-09 Thread Bill Bumgarner
On Mar 9, 2008, at 2:59 PM, stephen joseph butler wrote: On Sun, Mar 9, 2008 at 4:45 PM, Tony Becker [EMAIL PROTECTED] wrote: If you're on Leopard, there is a new backtrace(3) call. If you're on Tiger, it's a little more complex... You can use the compiler function

Re: How to get the name of a method at runtime?

2008-03-09 Thread Tony Becker
Agreed, I forgot to add that warning. I was using it to put fingerprints against alloc calls, retain/release cycles, and some other methods so I could track down memory leaks and some less then compliant code in debug builds. It should not end up in release builds. On Mar 9, 2008, at 6:06

Re: How to get the name of a method at runtime?

2008-03-09 Thread Jean-Daniel Dupas
ObjectAlloc and other Apple developement tools already record memory calls (retain, release, alloc, ...) full trace. You really doesn't need to reinvent the wheel to find leaks. Le 9 mars 08 à 23:17, Tony Becker a écrit : Agreed, I forgot to add that warning. I was using it to put

Re: How to get the name of a method at runtime?

2008-03-09 Thread Stuart Malin
Interesting approach, Tony. However, __builtin_return_address isn't an object, so stringWithFormat throws an exception when given the %@ token. It should be %u (or %U ?? - I'm not sure of the difference). So, just so I could step through the code in the debugger, I wrote: int

Undo the binding value

2008-03-09 Thread Liviu Andron
Dear all, The problem, shorty: I cannot undo a bounded control's value in the KVO events chain A) The situation (I'm not using a Mac right now, so some names might be wrong.) - multiple nibs, some controls with bounded

Re: How to avoid deactivation of window below utility window

2008-03-09 Thread Quincey Morris
On Mar 9, 2008, at 12:09, Peter Hoerster wrote: I have a background application which displays a floating utility window on request via hotkey. If the user clicks any item in my window, the window of the formerly front application gets deactivated. This is unfortunate because the utility

NSLog goes to system.log, and it should not

2008-03-09 Thread Larry Campbell
The NSLog(v) documentation says: NSLogv writes the log to STDERR_FILENO if the file descriptor is open. If that write attempt fails, the message is sent to the syslog subsystem, if it exists on a platform, with the LOG_USER facility (or default facility if LOG_USER does not exist), with

Re: NSLog goes to system.log, and it should not

2008-03-09 Thread Jeff Johnson
Larry, I believe it's expected behavior on Leopard, though you may want to file a bug at least against the documentation. The following links provide more information on this topic: http://lapcatsoftware.com/blog/2008/01/06/logging-in-leopard/

Re: NSLog goes to system.log, and it should not

2008-03-09 Thread Larry Campbell
Hmm, OK. I've opened radar #5789236; we'll see what Apple says. - lc On Mar 10, 2008, at 12:17 AM, Jeff Johnson wrote: Larry, I believe it's expected behavior on Leopard, though you may want to file a bug at least against the documentation. The following links provide more information