I have a boolean set for my preferences to check whether the user wants to backup the database at each start. My only question is how should I do it? I already log whether they want it or not, so I have got that far.

Should I read the contents of my backup file? How could I find that file, would it be safe to say: ~/Library/Preferences/Folder Name/ backup.xml

I hope you meant ~/Library/Application Support/...
If you started your project by using the "Core Data Application" template, you should have an app delegate class that implements an - applicationSupportFolder method. I'd use it like this: NSString *originalPath = [[[NSApp delegate] applicationSupportFolder] stringByAppendingPathComponent:@"data.xml"];

And read it, then write it into a new file? Or is there already a backup feature for this sort of thing (for non Time Machine users)?


If you really just want to copy a file from one place to another, take a look at the docs for NSFileManager, especially - copyItemAtPath:toPath:error: If you want to implement a more sophisticated backup functionality, like incremental backups, it will be more difficult than that.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to