• 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
Removing Application-Created Items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Removing Application-Created Items


  • Subject: Removing Application-Created Items
  • From: Andrew Merenbach <email@hidden>
  • Date: Sun, 11 Nov 2007 07:43:07 -0800

Hi, all,

I am working on a program that creates a standard preferences plist, a subdirectory under Application Support, and a folder for auxiliary data that is downloaded (this last one is placed at the top level of the user's home directory). I had a couple of questions:

1. It valid to set up a menu item, for user convenience, to "reset" the program and move any or all of these to the Trash? I get the feeling that the answer is No on the first two items, but I'm not sure about the last one. If the answer to these are "yes, if the files/ directories are in such-and-such a location," then what sort of location would be valid?

2. I have tried to remove a subdirectory of the auxiliary-downloads directory -- this subdirectory being named ".incoming" (with a period at the beginning) -- using the following method, but I get an error. Is this an example of sandboxing (about which I know very little), and if so, what are my options (assuming that I should)? Note that this method worked perfectly, as far as I can figure, on Tiger. (I just recently updated to Leopard and have changed nothing in the following method.)

+ (BOOL)deleteFileAtPath:(NSString *)path {
BOOL success = NO;

// Moves 'path' to the trash, a la NSWorkspace.
if ([[[self class] sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation
source:[path stringByDeletingLastPathComponent]
destination:@""
files:[NSArray arrayWithObject:[path lastPathComponent]]
tag:0])
{
success = YES;
}


	return success;
}

Cheers,
	Andrew
_______________________________________________

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: Removing Application-Created Items
      • From: Raffael Cavallaro <email@hidden>
  • Prev by Date: Re: Smart way to get "etched" borders in Leopard
  • Next by Date: Re: Get Preferred Application Icon URL for a given file
  • Previous by thread: Re: Get Preferred Application Icon URL for a given file
  • Next by thread: Re: Removing Application-Created Items
  • Index(es):
    • Date
    • Thread