views:

32

answers:

3

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?

A: 

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 !).

Paul R
no. But I am checking and loading one file that's in ~/Library/Application\ Support, but I have that set up correctly
Matt S.
+1  A: 

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.

James Raybould
nope. Still same problem. +1 for the IT crowd reference though!
Matt S.
Have you also tried cleaning all targets?`Build -> Clean All Targets`
James Raybould
yep. Still the same
Matt S.
A: 

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 :(

Matt S.