Re: are there any custom IB Palettes?
Re: are there any custom IB Palettes?
- Subject: Re: are there any custom IB Palettes?
- From: Wade Tregaskis <email@hidden>
- Date: Sat, 28 Feb 2004 17:49:15 +1100
Sorry for digging up an old topic, but I've finally gotten around to
looking at this again, and am having trouble with it still.
I recently wrote an IB palette for a few custom NSView subclasses,
and found it extremely difficult to do properly. In particular, one
subclass would invoke authorisation functions as part of it's normal
operation, which of course you don't want it doing in IB, but there's
no apparent way to differentiate between an instance in IB and in the
final app.
This is easy.
If you look in the IBApplicationAdditions.h header file in the
InterfaceBuilder framework you will notice this IB protocol which the
Application object in IB responds to
- (BOOL)isTestingInterface;
So if NSApp responds to selector isTestingInterface you are in
Interface Builder, if isTestingInterface returns yes, you are testing
the interface.
What exactly do you mean by 'NSApp'? NSApplication never responds to
'isTestingInterface', even when in IB, and it's not obvious from the
InterfaceBuilder framework headers exactly what object is supposed to.
I've fiddled around and probed various avenues without any success. So
far as I can tell, nothing implements the 'IB' protocol as defined in
InterfaceBuilder/IBApplicationAdditions.h.
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.