Re: finding bundle identifiers
Re: finding bundle identifiers
- Subject: Re: finding bundle identifiers
- From: "Rick C." <email@hidden>
- Date: Wed, 10 Jun 2009 05:25:00 -0700 (PDT)
hi ken,
thanks for the reply and insight. yes it seems no matter how i do it my idea is flawed because even if i start with a plist file and then try to find the associated app i will often find nothing since the app that did write the file did not necessarily follow naming after its bundle id. and the apps that create several plist files i'm assuming can have one file named after its bundle id but any others will not be since there's just one id correct? it does help me to move along to a better thought out plan. thank you very much for your time.
rick
________________________________
From: Ken Thomases <email@hidden>
To: Rick C. <email@hidden>
Cc: cocoa dev <email@hidden>
Sent: Wednesday, June 10, 2009 5:51:45 PM
Subject: Re: finding bundle identifiers
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