I am working ( or trying to) work my way through Apple's Core Data Utility Tutorial:
in order to solve an earlier issue 
But, from the very first change of code ie implementing GC, I am getting this error.
I am at a loss as to what is going on, as this is word for word from the tutorial.
For the sake of completeness, here is the code so far.
Any help as to how to approach this will be immensely appreciated.
HTML:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreDataUtilityTutorial/Articles/00_introduction.html#//apple_ref/doc/uid/TP40001800-CH202-TP1
But, from the very first change of code ie implementing GC, I am getting this error.
and stepping through the code, the lineThe Debugger has exited due to signal 10 (SIGBUS).The Debugger has exited due to signal 10 (SIGBUS).
throws an EXC_BAD_ACCESS.objc_startCollectorThread();
I am at a loss as to what is going on, as this is word for word from the tutorial.
For the sake of completeness, here is the code so far.
Code:
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
NSManagedObjectModel *managedObjectModel();
int main (int argc, const char * argv[]) {
/* NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; */
objc_startCollectorThread();
NSManagedObjectModel *mom = managedObjectModel();
NSLog(@"The managed object model is defined as follows:\n%@", mom);
// insert code here...
NSLog(@"Hello, World!");
/* [pool drain]; */
return 0;
}
NSManagedObjectModel *managedObjectModel() {
static NSManagedObjectModel *mom = nil;
if (mom != nil) {
return mom;
}
mom = [[NSManagedObjectModel alloc] init];
NSEntityDescription *runEntity = [[NSEntityDescription alloc] init];
[runEntity setName:@"Run"];
[runEntity setManagedObjectClassName:@"Run"];
[mom setEntities:[NSArray arrayWithObject:runEntity]];
NSAttributeDescription *dateAttribute = [[NSAttributeDescription alloc] init];
[dateAttribute setName:@"date"];
[dateAttribute setAttributeType:NSDateAttributeType];
[dateAttribute setOptional:NO];
NSAttributeDescription *idAttribute = [[NSAttributeDescription alloc] init];
[idAttribute setName:@"processID"];
[idAttribute setAttributeType:NSInteger32AttributeType];
[idAttribute setOptional:NO];
[idAttribute setDefaultValue:[NSNumber numberWithInteger:-1]];
NSExpression *lhs = [NSExpression expressionForEvaluatedObject];
NSExpression *rhs = [NSExpression expressionForConstantValue:
[NSNumber numberWithInteger:0]];
NSPredicate *validationPredicate = [NSComparisonPredicate
predicateWithLeftExpression:lhs
rightExpression:rhs
modifier:NSDirectPredicateModifier
type:NSGreaterThanPredicateOperatorType
options:0];
NSString *validationWarning = @"Process ID < 1";
[idAttribute setValidationPredicates:[NSArray arrayWithObject:validationPredicate]
withValidationWarnings:[NSArray arrayWithObject:validationWarning]];
NSArray *properties = [NSArray arrayWithObjects: dateAttribute, idAttribute, nil];
[runEntity setProperties:properties];
NSMutableDictionary *localizationDictionary = [NSMutableDictionary dictionary];
[localizationDictionary setObject:@"Date" forKey:@"Property/date/Entity/Run"];
[localizationDictionary setObject:@"Process ID" forKey:@"Property/processID/Entity/Run"];
[localizationDictionary setObject:@"Process ID must not be less than 1" forKey:@"ErrorString/Process ID < 1"];
[mom setLocalizationDictionary:localizationDictionary];
return mom;
}
Any help as to how to approach this will be immensely appreciated.