Re: Having problem with fetch request in NSDocument based application

2009-09-04 Thread Clayton Leitch
ption return an entity, and not nil? Does your context have a managed object model? On Fri, Sep 4, 2009 at 9:47 AM, Clayton Leitch wrote: Here is the code in MyDocument: -(IBAction)calculateStat:(id)sender{ fetchedObjects = nil; context = [self managedObjectContext]; fetchRe

Re: Having problem with fetch request in NSDocument based application

2009-09-04 Thread Clayton Leitch
I re-typed everything in a freshly produced document based application. Below is the top of the MyDocument.h file. // // MyDocument.h // Blood Pressure Record // // Created by Clayton Leitch on 9/3/09. // Copyright __MyCompanyName__ 2009 . All rights reserved. // #import @interface

Re: Having problem with fetch request in NSDocument based application

2009-09-04 Thread Clayton Leitch
The debugger shows 0 objects in the array. Interestingly, this same code works perfectly in a non-NSDocument version of this application. On Sep 4, 2009, at 10:29 AM, I. Savant wrote: On Sep 4, 2009, at 10:24 AM, Clayton Leitch wrote: Yes, I saved it as XML and opened the file. Below is

Re: Having problem with fetch request in NSDocument based application

2009-09-04 Thread Clayton Leitch
Savant wrote: Taking this back on-list where it belongs. On Sep 4, 2009, at 9:53 AM, Clayton Leitch wrote: Yes, there is a Measurement instance in the the data model. Debugger shows that everything is set properly until the array gets no objects in answer to the query. Are you sur

Having problem with fetch request in NSDocument based application

2009-09-04 Thread Clayton Leitch
Here is the code in MyDocument: -(IBAction)calculateStat:(id)sender{ fetchedObjects = nil; context = [self managedObjectContext]; fetchRequest = [[NSFetchRequest alloc] init]; entity = [NSEntityDescription entityForName:@"Measurement" inManagedObjectContext:context];

Getting managedObject Context

2009-08-29 Thread Clayton Leitch
I have spent the last month try to solve a simple problem. I need to get the managedObjectContext in a NSDocument based application. I know how to get this in a non-document based application -(NSManagedObjectContect *)managedObjectContext { if (!managedObjectContext) { mana

Re: Interesting Problem Code worked in 10.4 but not in 10.5

2008-06-22 Thread Clayton Leitch
8:19 PM, Jason Coco wrote: Is it possible that your NSDecimalNumber is no longer a valid object reference? On Jun 22, 2008, at 19:08 , Clayton Leitch wrote: Well, thanks to the list I now have a back trace below: #0 0x96cd5564 in NSDecimalCopy () #1 0x96d854f9 in NSDecimalSubtract () #2

Re: Interesting Problem Code worked in 10.4 but not in 10.5

2008-06-22 Thread Clayton Leitch
Well, thanks to the list I now have a back trace below: #0 0x96cd5564 in NSDecimalCopy () #1 0x96d854f9 in NSDecimalSubtract () #2 0x96dadad8 in -[NSDecimalNumber decimalNumberBySubtracting:withBehavior:] () #3 0x96dada47 in -[NSDecimalNumber decimalNumberBySubtracting:] () #4 0x1b67 i

Re: Interesting Problem Code worked in 10.4 but not in 10.5

2008-06-22 Thread Clayton Leitch
S”. 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 gues

Interesting Problem Code worked in 10.4 but not in 10.5

2008-06-22 Thread Clayton Leitch
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 "Monthl

Application Main window not appearing on application launch (updated)

2008-06-21 Thread Clayton Leitch
Core data document application: I edited the MyDocument.nib file to add a few fields to one view and now when I start the application, the main window does not appear. Also, the new menu fails to produce a window. What caused this and how do I avoid it. More information: The console te

Application Main window not appearing on application launch

2008-06-21 Thread Clayton Leitch
Core data document application: I edited the MyDocument.nib file to add a few fields to one view and now when I start the application, the main window does not appear. Also, the new menu fails to produce a window. What caused this and how do I avoid it. ___