• 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
Re: "First Run" installation of Application support stuff?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: "First Run" installation of Application support stuff? (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: Subject: Re: Cocoa Book / ok, ok.
  • Next by Date: Re: Subject: Re: Cocoa Book / ok, ok.
  • Previous by thread: Re: Hrm... I wonder... Re: "First Run" installation of Application support stuff?
  • Next by thread: Re: "First Run" installation of Application support stuff?
  • Index(es):
    • Date
    • Thread