mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-25 05:40:55 +00:00
* Documentation/GDL2Intro/Examples/eoexample.m: Use an EODatabaseDatasource. * Documentation/GDL2Intro/Examples/connection.m: Load the model file manually if it cannot be found. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@24317 72102866-910b-0410-8b05-ffd578937521
33 lines
843 B
Objective-C
33 lines
843 B
Objective-C
#include <Foundation/Foundation.h>
|
|
#include <EOAccess/EOAccess.h>
|
|
#include <EOControl/EOControl.h>
|
|
|
|
int main()
|
|
{
|
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
|
EOModelGroup *modelGroup = [EOModelGroup defaultGroup];
|
|
EOModel *model = [modelGroup modelNamed:@"library"];
|
|
EOAdaptor *adaptor;
|
|
EOAdaptorContext *context;
|
|
EOAdaptorChannel *channel;
|
|
|
|
/* Tools don't have resources so we have to add the model manually */
|
|
if (!model)
|
|
{
|
|
model = [[EOModel alloc] initWithContentsOfFile:@"./library.eomodel"];
|
|
[modelGroup addModel:model];
|
|
}
|
|
|
|
adaptor = [EOAdaptor adaptorWithName:[model adaptorName]];
|
|
context = [adaptor createAdaptorContext];
|
|
channel = [context createAdaptorChannel];
|
|
|
|
[channel openChannel];
|
|
|
|
/* insert code here */
|
|
|
|
[channel closeChannel];
|
|
[pool release];
|
|
return 0;
|
|
}
|
|
|