How do I create and use Objective-C objects in a C++ program

Discussion in 'Mac Programming' started by moonman239, Jan 26, 2015.

  1. moonman239 macrumors 68000

    Joined:
    Mar 27, 2009
    #1
    I'm looking to create a wrapper for Mac OS X's Location Services in pure C++. If I can do that, then I can create a Python module or a Ruby gem for accessing location services.

    I have not found any information on this.
     
  2. moonman239 thread starter macrumors 68000

    Joined:
    Mar 27, 2009
    #2
  3. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #3
    Look at RubyCocoa. You should be able to skip a few steps and use LocationServices more directly from ruby.

    -Lee
     
  4. kamy macrumors member

    Joined:
    Jul 27, 2011
    #4
    In one of our projects We have used 'C' functions to talk to 'Objective C' functions to do the Mac UI stuff.
    From C++ layer we just invoke the C functions.
     
  5. moonman239 thread starter macrumors 68000

    Joined:
    Mar 27, 2009
    #5
    Does anyone know if I can rely on .mm files to create relays between Objective-C and C++?
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    A .mm file is Objective-C++. You should look it up if you're not sure what that means. For example:
    http://en.wikipedia.org/wiki/Objective-C++#Objective-C.2B.2B

    There are more extensive references on Apple's developer website, but you might need to search outside of Apple to find older references.


    I don't understand what you mean by "relays", at least in the context of Objective-C++.
     

Share This Page