Cocoa app not launching on build & go but launching manually

128 views Asked by At

I have quite the interesting problem. Yesterday my program worked perfectly, but now today I'm getting exc_bad_access when I hit build and go, but if I launch the app from the build folder it launches perfectly and there seems to be nothing wrong.

The last bunch of lines from the debugger are:

#0  0xffff07c2 in __memcpy
#1  0x969f7961 in CFStringGetBytes
#2  0x96a491b9 in CFStringCreateMutableCopy
#3  0x991270cc in -[NSCFString mutableCopyWithZone:]
#4  0x96a5572a in -[NSObject(NSObject) mutableCopy]
#5  0x9913e6c7 in -[NSString stringByReplacingOccurrencesOfString:withString:options:range:]
#6  0x9913e62f in -[NSString stringByReplacingOccurrencesOfString:withString:]
#7  0x99181ad0 in -[NSScanner(NSDecimalNumberScanning) scanDecimal:]
#8  0x991ce038 in -[NSDecimalNumberPlaceholder initWithString:locale:]
#9  0x991cde75 in -[NSDecimalNumberPlaceholder initWithString:]
#10 0x991ce44a in +[NSDecimalNumber decimalNumberWithString:]

Why did my app work perfectly yesterday but not today?

3

There are 3 answers

0
Matt S. On BEST ANSWER

The problem was garbage collection. Disabled it and now it works, but now I get to go through and add some releases and stuff like that :(

1
Paul R On

Are you making any assumptions about the current working directory on launch ? This will be different depending on how you launch your app, so if you have any relative paths to files based on an assumed working directory then you may fail on one case but not in the other (especially if you're not doing any error checking when opening files !).

2
James On

Have you tried turning it off and on again?

It could be something that has gone wrong with XCode or any of the tools that it uses and it just needs a reboot to clean it up.