• 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 & prepareSavePanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data & prepareSavePanel


  • Subject: Core Data & prepareSavePanel
  • From: Todd Freese <email@hidden>
  • Date: Sat, 4 Mar 2006 20:54:41 -0600

In my core data doc-style app, I need to set the default filename for the save panel. I am using an XML type store. When I override prepareSavePanel the save panel works, but I get a "nil is not a valid persistent store" error. How do I set the store to XML? I have it set in my info.plist.

Here is my code:

- (BOOL)prepareSavePanel:(NSSavePanel*)savePanel
{
// Build default save to directory path. Start with program preference for the project root path.
NSMutableString *path = [NSMutableString stringWithString: [[NSUserDefaults standardUserDefaults] stringForKey:SS_ProjectRootPathKey]];
[path appendString:@"/"];

// Append colorist name to path.
[path appendString:[[[AppController sharedInstance] loggedInColorist] objectForKey:@"coloristName"]];
[path appendString:@"/"];

[savePanel setDirectory:path];

// Build default file name.
if ([self fileName] == nil) {
NSMutableString *fileName = [NSMutableString stringWithString:@""];
if ([[[self job] jobNumber] isNotEqualTo:@""]) {
[fileName appendString:[[self job] jobNumber]];
}
[self setFileName:fileName];
}


	return YES;
}

Todd Freese
The Filmworkers Club
_______________________________________________
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


  • Prev by Date: Re: how to debug notification that's never received?
  • Next by Date: Re: How to implement a preview view for printing
  • Previous by thread: Re: Thumbnails
  • Next by thread: Core Data & prepareSavePanel
  • Index(es):
    • Date
    • Thread