• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Interesting Problem Code worked in 10.4 but not in 10.5
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Jean-Daniel Dupas <email@hidden>
  • Date: Sun, 22 Jun 2008 23:43:45 +0200

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


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Interesting Problem Code worked in 10.4 but not in 10.5
      • From: Clayton Leitch <email@hidden>
References: 
 >Interesting Problem Code worked in 10.4 but not in 10.5 (From: Clayton Leitch <email@hidden>)

  • Prev by Date: Interesting Problem Code worked in 10.4 but not in 10.5
  • Next by Date: NSFormatter/NSControl and valid object notification
  • Previous by thread: Interesting Problem Code worked in 10.4 but not in 10.5
  • Next by thread: Re: Interesting Problem Code worked in 10.4 but not in 10.5
  • Index(es):
    • Date
    • Thread