Re: Interesting Problem Code worked in 10.4 but not in 10.5
Re: Interesting Problem Code worked in 10.4 but not in 10.5
- Subject: Re: Interesting Problem Code worked in 10.4 but not in 10.5
- From: Jason Coco <email@hidden>
- Date: Sun, 22 Jun 2008 18:43:18 -0400
There should be crash reports in ~/Library/Logs/CrashReporter – that
should give you the register state, thread stack, and information on
which thread crashed.
On Jun 22, 2008, at 18:38 , Clayton Leitch wrote:
Well, the only thing I get from the debugger is:
[Session started at 2008-06-22 18:35:23 -0400.]
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-956) (Wed Apr 30 05:08:47
UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-apple-darwin".Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/leitchc/Documents/Coding Efforts/
SoftCopyContract 2.0/build/Release/SoftCopyContract 2.0.app/Contents/
MacOS/SoftCopyContract 2.0', process 408.
Program received signal: “EXC_BAD_ACCESS”.
I tried all sorts of different settings, because in the past I have
gotten a stack.
On Jun 22, 2008, at 5:43 PM, Jean-Daniel Dupas wrote:
Launch it with the debugger and check the stack when it crash.
Without any hint about the stack, we cannot really help you, but
just give you some guess.
Le 22 juin 08 à 23:26, Clayton Leitch a écrit :
See code below. Get a error of “EXC_BAD_ACCESS” when I make
entries in the GUI. Code used to work with no problems. It
appears that it is doing an illegal substraction, which I think
means the objects are not being initialized with a value of 0. At
least that is my guess.
#import "MonthlyReport.h"
@implementation MonthlyReport
+ (void)initialize
{
if (self == [MonthlyReport class])
{
NSArray *keys = [NSArray arrayWithObjects:
@"reportCumActualCost", @"reportActualCost",
@"reportPredictedCost", @"reportCumPredictedCost",
@"reportCumlativeInvoiceTotal", @"reportMonthlyInvoiceAmount", nil];
[self setKeys:keys
triggerChangeNotificationsForDependentKey:@"reportCumDifference"];
[self setKeys:keys
triggerChangeNotificationsForDependentKey
:@"reportCurrentDifference"];
[self setKeys:keys
triggerChangeNotificationsForDependentKey
:@"reportPercentDifferenceMonth"];
[self setKeys:keys
triggerChangeNotificationsForDependentKey
:@"reportPercentDifferenceCum"];
[self setKeys:keys
triggerChangeNotificationsForDependentKey
:@"reportInvoiceMonthlyDifference"];
[self setKeys:keys
triggerChangeNotificationsForDependentKey
:@"reportInvoiceCumlativeDifference"];
}
}
//Calculate differences
- (NSDecimalNumber *)reportCurrentDifference;
{
return [[self valueForKey:@"reportActualCost"]
decimalNumberBySubtracting: [self
valueForKey:@"reportPredictedCost"]];
}
- (NSDecimalNumber *)reportCumDifference;
{
return [[self valueForKey:@"reportCumActualCost"]
decimalNumberBySubtracting: [self
valueForKey:@"reportCumPredictedCost"]];
}
- (NSDecimalNumber *)reportInvoiceMonthlyDifference;
{
return [[self valueForKey:@"reportMonthlyInvoiceAmount"]
decimalNumberBySubtracting:[self valueForKey:@"reportActualCost"]];
}
- (NSDecimalNumber *)reportInvoiceCumlativeDifference;
{
return [[self valueForKey:@"reportCumlativeInvoiceTotal"]
decimalNumberBySubtracting:[self
valueForKey:@"reportCumActualCost"]];
}
//Calculate percents
- (NSDecimalNumber *)reportPercentDifferenceMonth;
{
return [[[self valueForKey:@"reportCurrentDifference"]
decimalNumberByDividingBy: [self
valueForKey:@"reportPredictedCost"]]
decimalNumberByMultiplyingByPowerOf10: (short)2];
}
- (NSDecimalNumber *)reportPercentDifferenceCum;
{
return [[[self valueForKey:@"reportCumDifference"]
decimalNumberByDividingBy: [self
valueForKey:@"reportCumPredictedCost"]]
decimalNumberByMultiplyingByPowerOf10: (short)2];
}
@end
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
@gmail.com
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden