Re: "First Run" installation of Application support stuff?
Re: "First Run" installation of Application support stuff?
- Subject: Re: "First Run" installation of Application support stuff?
- From: Jeff Disher <email@hidden>
- Date: Mon, 9 Dec 2002 09:09:05 -0500
I wasn't referring to finding the folder. I was referring to actually
working with its contents. That is, checking that a folder exists for
your app (probably using the bundle identifiers like preferences do),
providing facilities for a generic storage dictionary like the
preferences, and the ability to get a path to your application's folder
in Application Support for storing things that you need to write
directly (if you are just copying a file, for example). It could also
handle the sort of synchronization that Dave was referring to in his
original post.
This isn't supposed be to be anything ground-breaking, just a small
object to make some of these tedious checks and serialization calls a
bit more convenient.
Jeff.
On Sunday, December 8, 2002, at 06:39 PM, Andreas Mayer wrote:
Am Sonntag, 08.12.02 um 22:08 Uhr schrieb Jeff Disher:
I think that this is a good idea. If I weren't in exams right now I
would write up a quick framework with something like that since it is
very useful.
What are you talking about?
Finding the Application Support Folder?
I use this:
#import <Foundation/Foundation.h>
@interface NSFileManager (AMAdditions)
- (NSString *)findSystemFolderType:(int)folderType
forDomain:(int)domain;
@end
#import "NSFileManagerAMAdditions.h"
//kUserDomain
//kApplicationSupportFolderType
//kCurrentUserFolderType
// more in CarbonCore/Files.h
@implementation NSFileManager (AMAdditions)
- (NSString *)findSystemFolderType:(int)folderType
forDomain:(int)domain
{
FSRef folder;
OSErr err = noErr;
CFURLRef url;
NSString *result = nil;
err = FSFindFolder(domain, folderType, false, &folder);
if (err == noErr) {
url = CFURLCreateFromFSRef(kCFAllocatorDefault, &folder);
result = [(NSURL *)url path];
}
return result;
}
@end
NSString *applicationSupportFolder = [[NSFileManager defaultManager]
findSystemFolderType:kApplicationSupportFolderType
forDomain:kUserDomain]
bye. Andreas.
Jeff Disher
President and Lead Developer of Spectral Class
Spectral Class: Shedding Light on Innovation
http://www.spectralclass.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.