• 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
Proper handling of NSSavePanel and 'Do you want to replace it?' dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proper handling of NSSavePanel and 'Do you want to replace it?' dialog


  • Subject: Proper handling of NSSavePanel and 'Do you want to replace it?' dialog
  • From: Sean McBride <email@hidden>
  • Date: Fri, 16 Sep 2011 14:33:22 -0400
  • Organization: Rogue Research Inc.

Hi all,

NSSavePanel will automatically show the user a 'Do you want to replace' sheet if he tries to save with an existing name.

What the correct way to proceed when replacement is needed?

Option 1: First delete the existing item yourself.  I've read this doesn't work when sandboxed (not sure if that's a bug or feature).

Option 2: Append/overwrite the existing item.  This works if you're writing a flat file and replacing a flat file.  But if the existing item is a directory, writeToURL:::: is giving me an "Error Domain=NSPOSIXErrorDomain Code=21 "The operation couldn’t be completed. Is a directory")"

What's the correct technique?

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Proper handling of NSSavePanel and 'Do you want to replace it?' dialog
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: NSTextField : Tooltip show Whole String, only when Truncated
  • Next by Date: Re: question about identifying old apps
  • Previous by thread: Re: NSTextField : Tooltip show Whole String, only when Truncated
  • Next by thread: Re: Proper handling of NSSavePanel and 'Do you want to replace it?' dialog
  • Index(es):
    • Date
    • Thread