• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core Data insert an Url
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Core Data insert an Url
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Apple's Secret Desktop Sauce
  • Next by Date: Re: Apple's Secret Desktop Sauce
  • Previous by thread: Re: Apple's Secret Desktop Sauce
  • Next by thread: Re: Core Data insert an Url
  • Index(es):
    • Date
    • Thread