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: Andreas Mayer <email@hidden>
- Date: Mon, 9 Dec 2002 00:39:04 +0100
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.
_______________________________________________
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.