Re: Name to PSN
Re: Name to PSN
- Subject: Re: Name to PSN
- From: Ken Thomases <email@hidden>
- Date: Sat, 21 Feb 2009 12:15:36 -0600
On Feb 21, 2009, at 11:38 AM, Pierce Freeman wrote:
Thanks for your reply.
You're welcome.
I see where you're coming from regarding NSWorkspace, and it seems
like a great idea! How would you recommend scanning it? A loop or
something else more creative?
A loop, sure. The same way you enumerate any array. Fast enumeration
if you're targeting Leopard, or using an index or NSEnumerator.
Is there some reason it is better/easier to use the bundle
identifiers instead of the
name?
A bundle ID is guaranteed to be unique and stable. With a name, there
may be other applications out there that are named the same thing.
Also, the user is free to rename your application, although I don't
know off-hand if the name provided by NSWorkspace is the on-disk name
or the CFBundleName.
And I assume you would get this by sorting through NSWorkspace as
well.
The bundle ID is one of the values in the dictionary elements of the
array returned from -launchedApplications.
Cheers,
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