[futurebasic] Re: [FB] FD_SpecialDirectoryGetFSRef fails

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2014 : Group Archive : Group : All Groups

From: Bernie <fblist.bw@...>
Date: Thu, 16 Oct 2014 15:54:16 +0100
Steve Crossman wrote:

> This code worked under previous versions of FB5 with _kPreferencesFolderType but it now crashes in FB5.7.8
> 
> _kApplicationSupportFolderType works and creates the folder as expected
> 
> Any help would be appreciated to determine why this is occurring.


Haven’t checked, but suspect earlier versions of FB5 used the deprecated FindFolder function to get special directories. In FB 5.7.8+, FD_SpecialDirectoryXxxx ends up calling a function that maps the old directory constants to NSXxxx constants. Trouble is, there is no NSXxxx equivalent of kPreferencesFolderType.

Two ways around it:
	Either use CFPrefs (NSUserDefaults) or build the path to the user preferences folder.