Core Data insert an Url
Core Data insert an Url
- Subject: Core Data insert an Url
- From: Filippo Trocca <email@hidden>
- Date: Thu, 15 Jun 2006 23:40:38 +0200
I'm a newbie on programming.
I try to create a movie's library with Core Data.
Any movie is registered with the its url on HD.
In a first simple version for understand Core Data, I use
awakeFromInsert for open a NSOpenPanel and take the url of my movie;
this is the code:
- (void) awakeFromInsert {
NSOpenPanel *openPanel;
int result;
openPanel = [NSOpenPanel openPanel];
result = [openPanel runModalForTypes:nil];
NSError *error;
if ( result== NSOKButton) {
NSArray *filesToOpen = [openPanel filenames];
NSString *fileName = [ filesToOpen objectAtIndex:0];
[self setUrl:fileName];
if ([QTMovie canInitWithFile:fileName])
{
QTMovie *sequenceMovie = [QTMovie movieWithFile:fileName
error:&error];
[self setPosterImage:[sequenceMovie currentFrameImage]];
}
}
}
I use a tableView with an ArrayController for work with NSManagedObject.
Now i wish open the NSOpenPanel, not from my Core Data ManagedObject,
but from a my controller and then insert my Entity... I look for a
way...
I Create a subclass of NSManagedObject: Sequence
In my controller addMovie method create a sequence object:
Sequence *mySequence;
I open a NSOpenPanel, get the url, try to set the url in mySequence
Object with my custom set method setUrl... Cocoa doesn't recognize
the accessor...
I hope to explain in a good way the problem, my english is far to
good english
Thaks
Filippo Trocca
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden