• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Calling an Obj-C method from a C++ class, how?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling an Obj-C method from a C++ class, how?


  • Subject: Re: Calling an Obj-C method from a C++ class, how?
  • From: "Roni Music" <email@hidden>
  • Date: Thu, 7 Oct 2004 16:18:56 +0200


----- Original Message -----
From: "Karin Kosina" <email@hidden>
To: "Rolf Nilsson" <email@hidden>
Cc: <email@hidden>
Sent: Thursday, October 07, 2004 3:25 PM
Subject: Re: Calling an Obj-C method from a C++ class, how?


> On Thu, 7 Oct 2004 15:17:48 +0200, Rolf Nilsson <email@hidden> wrote:
>
> > My problem is how to call an Obj-C method from a C++ class.
>
> Objective-C++ is your friend. :)
>
> Rename your .cpp file to .mm, and simply do the usual magic:
> [m_pMyControllerCocoaObj aCocoaMethodWithTwoArguments:foo
>
> anIntValue:bar];


how could I miss that?

>
> Or did I misunderstand what you're trying to do?

No but I'm a C++ guy, I never got what you suggest to work because I forgot to include the controller class header file
and got compile error that I didn't understand so tried a difficult solution

Works fine now, thanks!

btw, I allready use Objective-C++


Rolf

>
> --
> We are Elektropeople for a better living.
>
> Karin Kosina, KSC (vka kyrah)
> http://kyrah.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Calling an Obj-C method from a C++ class, how? (From: Rolf Nilsson <email@hidden>)
 >Re: Calling an Obj-C method from a C++ class, how? (From: Karin Kosina <email@hidden>)

  • Prev by Date: Problems Subclassing NSDateFormatter in IB
  • Next by Date: Re: Problems Subclassing NSDateFormatter in IB
  • Previous by thread: Re: Calling an Obj-C method from a C++ class, how?
  • Next by thread: How to get default date format?
  • Index(es):
    • Date
    • Thread