gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Operating specific bundle resources?


From: Richard Frith-Macdonald
Subject: Operating specific bundle resources?
Date: Thu, 8 Jan 2009 09:40:48 +0000

It seems that the NSBundle code for returning a path to a file with a particular extension (pathForResource:ofType:inDirectory: etc) has an undocumented feature of preferring to return the path to name- operatingsystem.ext rather than name.ext if it can find a file with that name (where operatingsystem is the name of the operating system the program is running on).

This is presumably to return system specific files in preference to generic versions, but it's an undocumented (as far as I can tell) feature which, does not actually seem to be used anywhere. I'm going to remove this and make the code match the documentation (and the MacOS-X implementation), but if there is actually a good reason for this code to be there we can add it back (and document it). It seems to me that there is no good reason to have a special case to try to load operating system specific resources, and if we did want to do that, we should probably have such resources in a subdirectory rather than having the system name as a suffix to the filename. If anyone was to actually use name-operatingssystem.ext it would presumably confuse any code which makes use of the pathsForResourceOfType: method as this would return both versions of the file (name.ext and name- operatingsystem.ext).






reply via email to

[Prev in Thread] Current Thread [Next in Thread]