Re: finding bundle identifiers
Re: finding bundle identifiers
- Subject: Re: finding bundle identifiers
- From: Ken Thomases <email@hidden>
- Date: Wed, 10 Jun 2009 04:51:45 -0500
On Jun 10, 2009, at 4:27 AM, Rick C. wrote:
to be more specific on what i'm trying to do i would like to be able
to review the files in a preferences folder and find the related app
on the system. so i was trying to come up with a list of
identifiers for comparison. but it seems that some files in a
preferences folder (plists) do not match up with the identifier of
the related app. maybe this is due to the fact that a single app
can create multiple plist files. any input on how i can achieve
what i'm trying to do?
It's not generally possible to go from an arbitrary file to some
"related" app. And the files in the .../Library/Preferences folders
are effectively arbitrary. Sure, the vast majority of them are
created by the CFPreferences or NSUserDefaults APIs, in which case
they are probably named after bundle IDs, but some apps just write
files directly to those folders. Those apps don't always name their
files using their bundle IDs.
Even if you do assume that those files are named after bundle IDs,
then it seems strange to try to go from the list of all application
bundle IDs to the files. Why not go from the file names, parsing out
the bundle IDs, to the apps? It's easy enough to look up or
manipulate an app given its bundle ID.
Lastly, you might be working from the files when you should be working
from preference domains. The frameworks currently work in terms
of .plist files, but there's no guarantee that they will in the
future. They may start working in terms of some unified database, or
whatever. You might want to use -[NSUserDefaults
persistentDomainNames] or CFPreferencesCopyApplicationList.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden