[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sat, 13 Jun 2015 10:18:36 +0200
I created an application , and tried to integrate some code I found in
The code (sloppy, with unused variables) in ApplicationDidFinishLaiunching looks as follows:
- (void) applicationDidFinishLaunching: (NSNotification *)aNotif
// Uncomment if your application is Renaissance-based
// [NSBundle loadGSMarkupNamed: @"Main" owner: self];
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
aModelGroup = [EOModelGroup globalModelGroup];
aModel = [aModelGroup modelNamed:@"MultiDB"];
NSLog(@"model initialized? %@", aModel);
adaptor = [EOAdaptor adaptorWithModel:aModel];
NSLog(@"adaptor initialized? %@", adaptor);
NSLog(@"model in adaptor? %@", [adaptor model]);
context = [adaptor createAdaptorContext];
NSLog(@"context initialized? %@", context);
channel = [context createAdaptorChannel];
NSLog(@"channel initialized? %@", channel);
ec = [[EOEditingContext alloc] init];
NSLog(@"editing context initialized? %@", ec);
authorsDS = [[EODatabaseDataSource alloc] initWithEditingContext: ec entityName:@"Persons"];
NSLog(@"data source initialized? %@", authorsDS);
This is the end of the NSLOG output:
2015-06-13 09:49:22.758 Crud[10089:10089] editing context initialized? <EOEditingContext: 0x8c8a6b8>
2015-06-13 09:49:22.759 Crud[10089:10089] Problem posting notification: <NSException: 0x8c9da60> NAME:NSInvalidArgumentException REASON:adaptorWithModel: -- EOAdaptor 0xb695c9f0: no model specified INFO:(null)
I suspect the error is at initializing the variable AuthorsDS, (the complete output is in the attached file).
What I don't get is how authorsDS is linked to the prevously created model aModel since I just did alloc - init for the editingcontext.
In that sense it seems logic that no model is found and an error occurs.
Can someone help with this?
Description: Binary data
- GDL2 problem,
Edwin Ancaer <=