I would like to know if its possible to C++ to code an application using the Cocoa Programming or do i have to use C
Thanks
Thanks
A few years ago I wrote a hybrid Obj-C/C++ application. It was a port of a final project I did one of my early CS classes. I used Obj-C to handle GUI events and kept the C++ basically the same. The big problem with Obj-C that I ran into was that file i/o cannot handle C++ strings. I had to go on a character by character basis (I could have used character arrays but this was faster).
Ok so basicaly im stuck with objective C, This leaves me a problem I want to build an application that works universaly with all operating systems but it looks like im going to have to rewrite it if i want to. Is this true
A few years ago I wrote a hybrid Obj-C/C++ application. It was a port of a final project I did one of my early CS classes. I used Obj-C to handle GUI events and kept the C++ basically the same. The big problem with Obj-C that I ran into was that file i/o cannot handle C++ strings. I had to go on a character by character basis (I could have used character arrays but this was faster).
How about using cpp files in already built cocoa application ... can I use both languages - objective c and c++ in one project ?
CFString (a C++ Carbon class) ...
Ok so basicaly im stuck with objective C, This leaves me a problem I want to build an application that works universaly with all operating systems but it looks like im going to have to rewrite it if i want to. Is this true
Ok so basicaly im stuck with objective C, This leaves me a problem I want to build an application that works universaly with all operating systems but it looks like im going to have to rewrite it if i want to. Is this true
It's probably a good idea to keep the UI separate from the actual application (if you're developing an application for Apple's "48-bit" Operating System Tiger, then that's the only option anyway).
Keep the actual application in a separate process, and exchange data with the UI process using IPC, shared memory, or something similar.
(see http://developer.apple.com/macosx/64bit.html, "Adding a GUI to a 64-bit Application")
Sorry to be pedantic, Mongo, but I'm going to be anyway. CFString is neither C++ nor Carbon!
- (std::string) asStdString;
+ (NSString*) stringWithStdString:(const std::string&) stdString;
Ok so basicaly im stuck with objective C, This leaves me a problem I want to build an application that works universaly with all operating systems but it looks like im going to have to rewrite it if i want to. Is this true
Sorry to be pedantic, but CFString is Carbon; you can use it in C, C++, Objective-C and Objective-C++, but it is really deprecated.