Skip navigation.
 
mlRe: Debugger at odds with reality? [SOLVED]
FROM : Jerry Krinock
DATE : Sun Apr 27 22:43:52 2008

On 2008 Apr, 27, at 2:47, Graham Cox wrote:

> I'd still like to know more about how all this actually works - I 
> feel I'm groping in the dark when things go wrong.


Graham, welcome to the apparently small club (about 3-4 oddballs) who 
care about what version and configuration of their private framework 
gets packaged or run.  For more info, search xcode-
<email_removed> archives for past month or two.  Here are a 
couple of interesting facts to get you started:

1.  If you set a "Copy Files" Build phase to "Frameworks", Xcode will 
always copy the same Build Configuration regardless of which 
configuration you're building.  I've found it to always copy Release, 
but someone else reported that it always copies Debug.

2.  Say you set a private framework to build in the normal way, with 
Installation Directory = @executable_path/../Frameworks.  In the app 
project, set the Build Configuration to Debug and Run in Xcode.  The 
framework that gets run is apparently the one in your Builds 
directory, not the one in the app package.  However, if you 
doubleclick the app's Debug build in Finder, it runs the one in the 
app package, which is what I expect it to do in any case. [1]

The second fact is possibly what is causing the problem you saw 
yesterday.

Consider putting some tattletale code such as the following in your 
framework.  (Untested code composed in Mail.app)

Class class = ... ; // Some class defined in your framework
NSString *msg = [NSString stringWithFormat:
                  @"Class %@ was loaded from %@",
                  class,
                  [[NSBundle bundleForClass:class] bundlePath]] ;

NSLog(msg) ;

Anyhow this is more of an Xcode issue so I'd recommend that further 
discussion be done in <email_removed>.

Jerry


[1] I discovered this by accident yesterday when I had implemented the 
same class in two private frameworks.

When running in Xcode, I get this message in the Xcode console:

Class SSLocalizeBundleGetter is implemented in both /Users/jk/
Documents/Programming/Builds/Debug/SSSQLiter.framework/Versions/A/
SSSQLiter and /Users/jk/Documents/Programming/Builds/Debug/
SSLocalize.framework/Versions/A/SSLocalize. Using implementation from /
Users/jk/Documents/Programming/Builds/Debug/SSLocalize.framework/
Versions/A/SSLocalize.

But upon doubleclicking that same build in Finder, I get this message 
in Console.app:

Class SSLocalizeBundleGetter is implemented in both /Users/jk/
Documents/Programming/Builds/Debug/MyApp.app/Contents/MacOS/../
Frameworks/SSSQLiter.framework/Versions/A/SSSQLiter and /Users/jk/
Documents/Programming/Builds/Debug/MyApp.app/Contents/MacOS/../
Frameworks/SSLocalize.framework/Versions/A/SSLocalize. Using 
implementation from /Users/jk/Documents/Programming/Builds/Debug/
MyApp.app/Contents/MacOS/../Frameworks/SSLocalize.framework/Versions/A/
SSLocalize.

Related mailsAuthorDate
mlDebugger at odds with reality? Graham Cox Apr 26, 15:20
mlRe: Debugger at odds with reality? Keary Suska Apr 26, 16:31
mlRe: Debugger at odds with reality? Colin Cornaby Apr 27, 08:14
mlRe: Debugger at odds with reality? [SOLVED] Graham Cox Apr 27, 11:47
mlRe: Debugger at odds with reality? [SOLVED] Ian Jackson Apr 27, 12:13
mlRe: Debugger at odds with reality? [SOLVED] Jerry Krinock Apr 27, 22:43
mlRe: Debugger at odds with reality? [SOLVED] Chris Hanson Apr 29, 06:34
mlRe: Debugger at odds with reality? [SOLVED] Jerry Krinock Apr 30, 02:17