On Mar 23, 2008, at 11:23 AM, muni wrote:
>
> Just as feedback .. Objective-C is a superset of ANSI/ISO C, not C++.
> Specially not MFC. If your application was written in C then the port
> would be trivial. C++ classes are not compatible on objective C as
> much as I can tell.
>
Name your source files ending with .mm or .M and you can use C++.
There is not binding from C++ to Objective-C methods but you could add
them if you really want.
You can call C++ and Obj-C methods from each other if you know what
you are doing. The only issue is the syntax is ugly without writing
your own bindings.
As far as cocoa development, though not the iPhone, you can even
intermix Ruby and Python objects, including subclassing an Obj-C
object with a Ruby object and visa versa.
If you write the C++ binding then you could subclass an Obj-C object
with a C++ object.
iPhone has no Ruby or Python support so you can't do that on the iPhone.
http://en.wikipedia.org/wiki/Objective-C#Objective-C.2B.2B
On Mar 24, 2008, at 1:55 PM, muni wrote:
>
I'm sure you are very ernest, but you are really starting to stretch a
point.
For example, I can easily do the following:
std::map<std::string, NSObject *> myMaps;
You can also write code like this:
class MyCObject
{
public:
MyCObject() { myObjCObject = [[NSObject alloc] init]; }
private:
NSObject *myObjCObject;
};
And you can do the following:
@interface MyObjcObject : NSObject {
std::string m_CPPString;
}
@end
Now, I want to clarify, there are things you cannot do, and some would
say that you don't have 100%. However, your original point was that
you couldn't do anything at all. If I may quote you:
>>> and c+
>>> +. You can have a cocoa application written purely in C++ but you
>>> cannot have both C++ and Objective-C in the same App. The idea is to
>>> desist the usage of C++ and use only Objective-C + ANSI C.
>
I do notice that your latest comment is a lot less, shall we say,
strident.