• 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: can C++ object use Object C objects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can C++ object use Object C objects?


  • Subject: Re: can C++ object use Object C objects?
  • From: Scott Andrew <email@hidden>
  • Date: Fri, 2 Sep 2005 14:56:37 -0700

So my derived class just has to live in a .mm extension?? Thats it? Are there any limitations?

so my .h can have:

class CMyMacClass : public CMyXPlatClass
{
    NSString* pstring;

    NSString* GetString();

}

cool. So then I just need to write a thin object wrapper so my object can live in a NSArrayController. that would just stash this object then return the string.


Scott

On Sep 2, 2005, at 2:36 PM, KJ Walker wrote:


On Sep 2, 2005, at 14:19, Scott Andrew wrote:


Ok. i thought i had seen docs on this but can't find it.

Using the GNU compiler can a C++ object use ObjectC objects? Can i say

void foo::myfunc()
{
    [object message];
}

can C++ use and return objective C objects?


If the file is being processed as Objective-C++ then yes. To have a file compiled in this way it needs to have a .mm extension (I believe) if using the default settings, or settings that affect that file need to be set specifically to Objectice-C++.


For return types it would have to be a pointer to a Obj-C object, but since that is the way they are typically represented in code that's a pretty moot point.

KJ
Senior Mac Developer
SmartSound Software, Inc.





_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: can C++ object use Object C objects?
      • From: KJ Walker <email@hidden>
References: 
 >can C++ object use Object C objects? (From: Scott Andrew <email@hidden>)
 >Re: can C++ object use Object C objects? (From: KJ Walker <email@hidden>)

  • Prev by Date: Re: can C++ object use Object C objects?
  • Next by Date: Re: can C++ object use Object C objects?
  • Previous by thread: Re: can C++ object use Object C objects?
  • Next by thread: Re: can C++ object use Object C objects?
  • Index(es):
    • Date
    • Thread