• 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: Best way of getting /Library/Preferences paths?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way of getting /Library/Preferences paths?


  • Subject: Re: Best way of getting /Library/Preferences paths?
  • From: Finlay Dobbie <email@hidden>
  • Date: Sat, 18 Sep 2004 11:36:27 +0100


Your code leaks. I edited it below :-)

On 18 Sep 2004, at 10:20, Andreas Mayer wrote:

- (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);
if (url != NULL) {
result = [(NSURL *)url path];
			CFRelease(url);
		}
	}

	return result;
}

:-)

 -- Finlay

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Best way of getting /Library/Preferences paths?
      • From: Andreas Mayer <email@hidden>
References: 
 >Best way of getting /Library/Preferences paths? (From: Christoffer Lerno <email@hidden>)
 >Re: Best way of getting /Library/Preferences paths? (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: Best way of getting /Library/Preferences paths?
  • Next by Date: Re: Creating popup button's menu at the last moment
  • Previous by thread: Re: Best way of getting /Library/Preferences paths?
  • Next by thread: Re: Best way of getting /Library/Preferences paths?
  • Index(es):
    • Date
    • Thread