Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 132929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:20:27+00:00 2026-05-11T06:20:27+00:00

I’ve found my devices using IOServiceGetMatchingServices and got the property dictionary like this: kernResult

  • 0

I’ve found my devices using IOServiceGetMatchingServices and got the property dictionary like this:

kernResult = IORegistryEntryCreateCFProperties(nextMedia,                     (CFMutableDictionaryRef *)&props,                                               kCFAllocatorDefault, 0); 

From that dictionary I can extract the informations for the icons:

NSString *bId = [props valueForKeyPath:@'IOMediaIcon.CFBundleIdentifier']; NSString *rFile = [props valueForKeyPath:@'IOMediaIcon.IOBundleResourceFile']; 

Those two give me this (as an example):

 com.apple.iokit.IOStorageFamily   (Bundle identifier) Internal.icns                     (Resource File) 

I tried to extract the icon using this method:

NSBundle *bundleWithIcon = [NSBundle bundleWithIdentifier:bId]; NSString *iconPath = [bundleWithIcon pathForResource:rFile ofType:nil]; 

But bundleWithIcon is nil.

Is this even the correct method to get the icon?

I think I have to somehow load the bundle to be able to load it with bundleWithIdentifier, how can I do this?

PS: There’s another question which (I think) tries to ask the same thing, but only asks for bundles, not if this is the correct way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:20:27+00:00Added an answer on May 11, 2026 at 6:20 am

    Just recently Andrew Myrick answered a similar question on the darwin-dev mailing list:

    KextManagerCreateURLForBundleIdentifier() in <IOKit/kext/KextManager.h> may be of use, though I believe it only works for kexts that are either 1) loaded, or 2) in /S/L/E/. Here is the Snow Leopard headerdoc:

    /*!  * @function KextManagerCreateURLForBundleIdentifier  * @abstract Create a URL locating a kext with a given bundle identifier.  *  * @param    allocator  *           The allocator to use to allocate memory for the new object.  *           Pass <code>NULL</code> or <code>kCFAllocatorDefault</code>  *           to use the current default allocator.  * @param    kextIdentifier  *           The bundle identifier to look up.  *  * @result  * A CFURLRef locating a kext with the requested bundle identifier.  * Returns <code>NULL</code> if the kext cannot be found, or on error.  *  * @discussion  * Kexts are looked up first by whether they are loaded, second by version.  * Specifically, if <code>kextIdentifier</code> identifies a kext  * that is currently loaded,  * the returned URL will locate that kext if it's still present on disk.  * If the requested kext is not loaded,  * or if its bundle is not at the location it was originally loaded from,  * the returned URL will locate the latest version of the desired kext,  * if one can be found within the system extensions folder.  * If no version of the kext can be found, <code>NULL</code> is returned.  */ CFURLRef KextManagerCreateURLForBundleIdentifier(     CFAllocatorRef allocator,     CFStringRef    kextIdentifier); 

    Note that prior to Snow Leopard, it may only work for kexts in /S/L/E; the API existed, but there was no headerdoc describing its behavior.

    For me this worked really well on Mac OS X 10.5.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.