Re: Using C++ classes from Objective C

2008-03-20 Thread Rob Napier
On Wed, Mar 19, 2008 at 4:12 PM, Jeremy [EMAIL PROTECTED] wrote: Hi. I am just starting to learn Cocoa and would like to use standard C++ classes from my Objective C/C++ classes. You really don't. You think you do (probably because you know C++), but then you enter the crazy messed up world

Re: Using C++ classes from Objective C

2008-03-20 Thread John Stiles
Without starting a religious war, I have to disagree with this. ObjC++ is probably a bad idea if you are a novice programmer in general, but I think it also has some really good things going for it, and having written huge amounts of ObjC++ code, I think it's perfectly straightforward to use.

Re: Using C++ classes from Objective C

2008-03-20 Thread Christopher Nebel
On Mar 20, 2008, at 10:32 AM, Rob Napier wrote: Say you have a C++ object called MyObject in the namespace myapp that you want to access through your ObjC. What I tend to do is create an ObjC++ object called MyObjectWrapper that owns a myapp::MyObject and presents a pure ObjC interface to

Re: Using C++ classes from Objective C

2008-03-20 Thread Clark Cox
On Thu, Mar 20, 2008 at 11:33 AM, Christopher Nebel [EMAIL PROTECTED] wrote: On Mar 20, 2008, at 10:32 AM, Rob Napier wrote: Say you have a C++ object called MyObject in the namespace myapp that you want to access through your ObjC. What I tend to do is create an ObjC++ object called

Re: Using C++ classes from Objective C

2008-03-20 Thread Rob Napier
Yep, stringWithUTF8String/UTF8String works well for std:string. I recommend creating NSStringForStdString() and StdStringForNSString() utility functions, and possibly an NSString category to add -stdStringValue. -Rob On Thu, Mar 20, 2008 at 4:05 PM, Jeff LaMarche [EMAIL PROTECTED] wrote: What

Re: Using C++ classes from Objective C

2008-03-20 Thread Scott Thompson
On Mar 20, 2008, at 2:34 PM, Jeremy wrote: Thanks everyone! Using a void* for the member variable of my wrapper class did the trick and I now have my Objective C code calling my C++ code! What is the best way to pass strings from my Objective C code to my C ++ code though? I started

Using C++ classes from Objective C

2008-03-19 Thread Jeremy
Hi. I am just starting to learn Cocoa and would like to use standard C++ classes from my Objective C/C++ classes. Is there any known documentation on how to do this, or does anyone have any pointers? I tried creating a new object of my C++ class and calling a method on it in a .m file

Re: Using C++ classes from Objective C

2008-03-19 Thread John Stiles
Are you #including the header which declares MyClass? Jeremy wrote: Hi. I am just starting to learn Cocoa and would like to use standard C++ classes from my Objective C/C++ classes. Is there any known documentation on how to do this, or does anyone have any pointers? I tried creating a