Objective-C++ Instance Variables

Discussion in 'Programmer Misc' started by Jason8, Jul 3, 2008.

  1. Jason8

    Jason8 Guest

    hi:

    I'm trying to bridge between my Cocoa App and my C++ framework via
    Objective-C++. Apparently I can't have C++ objects as instance
    variables in my ObjC class because they contain virtual methods. Also,
    I don't appear to be able to include my C++ header files in by ObjC
    header file; they work fine if I include them in my implementation
    file (.mm).

    How should I create my C++ objects and use them within my ObjC class
    (over it's lifetime)?

    Perhaps I should be doing this a different way? What I have is a C++
    framework compiled into a dylib. I include the headers in my .mm and
    link in the dylib.
     
    Jason8, Jul 3, 2008
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Florian Zschocke

    NSWindowController - new instance ?

    Florian Zschocke, Apr 16, 2004, in forum: Programmer Help
    Replies:
    3
    Views:
    235
    Florian Zschocke
    Apr 20, 2004
  2. kelvSYC
    Replies:
    5
    Views:
    276
  3. kelvSYC
    Replies:
    0
    Views:
    376
    kelvSYC
    Jun 5, 2005
  4. kelvSYC
    Replies:
    0
    Views:
    340
    kelvSYC
    Aug 25, 2005
  5. eugen

    NSApplication instance

    eugen, Apr 2, 2006, in forum: Programmer Help
    Replies:
    2
    Views:
    207
    eugen
    Apr 2, 2006
  6. Jason8

    Objective-C++ Instance Variables

    Jason8, Jul 3, 2008, in forum: Programmer Help
    Replies:
    7
    Views:
    226
    David Phillip Oster
    Jul 5, 2008
  7. kalpesh

    Single instance of application for each session

    kalpesh, Sep 2, 2009, in forum: Programmer Help
    Replies:
    1
    Views:
    306
    Simon Slavin
    Sep 2, 2009
  8. D.M. Procida
    Replies:
    6
    Views:
    214
    Rolly
    Nov 27, 2007
Loading...