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 7520937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:09:11+00:00 2026-05-30T02:09:11+00:00

I wanted to call the following function from OS X’s DVDPlayback framework: OSStatus DVDGetMediaVolumeCFName

  • 0

I wanted to call the following function from OS X’s DVDPlayback framework:

OSStatus DVDGetMediaVolumeCFName (
   CFStringRef *outDiscVolumeCFName
);

Eventually, I came up with the following working code:

framework 'DVDPlayback'
p2 = Pointer.new_with_type('^{__CFString}')
DVDGetMediaVolumeCFName(p2)

But I didn’t find the '^{__CFString}' bit in any documentation and only found out what it was really doing afterward (I originally cut and pasted it from an error message). I first tried Pointer.new with both :id and :string with no success.

So my questions are:

  • what’s the best way to get this pointer (my way seems ugly)?
  • why didn’t Pointer.new(:string) work? I thought String, NSString, and CFString were equivalent
  • where would I have looked to find this info? (I checked the MacRuby site, “macro Pointer” reported “Nothing known about Pointer”, ~12 google hits, and “MacRuby: The Definitive Guide”)
  • 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. Editorial Team
    Editorial Team
    2026-05-30T02:09:12+00:00Added an answer on May 30, 2026 at 2:09 am

    Although there exists a “toll-free” bridge from NSString to CFStringRef, the same does not apply for NSString* to CFStringRef*, due to the use of ARC (Automatic Reference Counting). Casting a CFStringRef* to NSString* requires the use of __bridge, therefore

    Pointer.new(:string)
    

    will not work. Using

    Pointer.new_with_type('^{__CFString}')
    

    is the best way get this pointer and the best way to find this information is to view the TypeError that is generated when the incorrect type is chosen. For example:

    expected instance of Pointer of type `^{__CFString}', got `*' (TypeError)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to call the GetIdsOfNames function from a COM object that implements the
I wanted to call Test1() Method Within WaitAndCallFunc() Function. Code: typedef void (*func)(); void
Following on from another question I asked, Scala 2.8 breakout , I wanted to
I have the following in my main html: jQuery(document).ready(function(){ jQuery('body').flvplay(songlist, {something});}); I wanted to
I have the following function, when I call it's printing out the mess but
I have the following function that is pulling data from a database. The ajax
I have this class file call SMSHelper.cs First I just wanted to know is
Wanted to know if there was a way one could query shelveset details from
just wanted to ask where I define initial class properties? From other languages I
For example I wanted to do the following: namespace Test { static bool PerformTest()

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.