I've been learning Objective-C and Cocoa by working my way through the Hillegass book and it occurs to me that I might be better off using Objective-C++. Objective-C seems like the clear choice for developing UIs but I have a very strong C++ background and would love to develop application back-ends in C++ and use Objective-C++ to do the...
I'm reading a post about iPhone programming and I've noticed that the talk about Objective C++, the code shown in the post looks mainly like Objective-C but there also are several snippets in C++. Is it really possible to program Cocoa from C++?
...
I want to make an iPhone app, but I am planning to make the framework in C++. Is it possible to use things like templates in Objective-C++. I guess really the question is, can I use boost?
...
I want to use some C++ STL collections in my Objective-C iPhone app. Apparently this is possible by giving files the extension ".mm" . What are some of the quirks/surprises associated with this?
I want to use the basic containers that I'm familiar with (vector, queue, set, ...)
Cheers!
...
Hello!
I need to mix Objective-C and C++. I would like to hide all the C++ stuff inside one class and keep all the others plain Objective-C. The problem is that I want to have some C++ classes as instance variables. This means they have to be mentioned in the header file, which gets included by other classes and C++ starts spreading to ...
I've got a project that is primarily in C++, but I'm trying to link in a Objective-C++ library. I have a header that looks something like:
CPlus.h:
#import "OBJCObject.h"
class CPlus {
OBJCObject *someObj;
};
CPlus.mm:
CPlus::CPlus() {
someObj = [[OBJCObject alloc] init];
}
When I import the Objective-C++ header into my code...
Currently I am working on a piece of software, which is currently written 100% in Objective-C using the iPhone 3.0 SDK.
I have come to a cross roads where I need to do quite a bit or string concatenation, more specifically, NSString concatenation and so far I have been doing it like this:
Objective-C string concatenation:
NSString *re...
I have a C++ class 'Expression' with a method I'd like to use in my Objective-C class 'GraphVC'.
class Expression {
double evaluate(double);
}
And my Objective-C class:
@implementation GraphVC : UIViewController {
- (void)plot:(double(*)(double))f;
@end
I thought that it would be easiest to pass around function pointers that ta...
Hi. I have a c++ app that I'm trying to port to iPhone and to start off I'm trying to replace my c++ texture loader with an obj-c++ texture loader so that I can make use of the cocoa libraries.
A lot of my c++ files (.cpp files) call the texture loader with something like:
GLuint mTexture = TextureLoader::LoadTexture("file.png") //Load...
I know it's part of gcc but is it useable on Windows? The (core) runtime with its garbage collector does seem to be pretty complicated to port so i doubt it will be portable by coincidence. I don't want any Cocoa stuff just the pure metal basic support.
What about other unix versions Solaris/FreeBSD/AIX/HP-UX ?
...
I am trying to load a Nib from a C++ constructor with Objective C++. I have searched and found enough examples to get some code together but it doesn't display the window. Or any windows for that matter.
Here is an example of the contructor:
JokeSystem::JokeSystem() : fileSystem("/Library/Application Support/Jokes/")
{
try
{
...
hej.h
void hej();
hej.m
void hej(){}
main.mm
#import "hej.h"
int main(int argc, char *argv[])
{
}
This gives me:
"hej()", referenced from:
_main in main.o
symbol(s) not found
If I rename main.mm to main.m (single m), or hej.m to mm or cpp, then it works. (Though none of those "solutions" are preferable. Imagine you want to u...
I encountered following weird behavior yesterday. It seems a compiler bug to me or is there a something that I've missed? I was wrapping Facebook Connect for iPhone's Objective-C classes with Objective-C to C++ adaptor classes, so that they could be used from our own OpenGL/C++ code more conveniently.
The following code reveals the prob...
I am trying to expose the pathForResource functionality to C++ from objective-c.
However, I am very new to objective-c and have not been able to discern how to use a c string as an argument in objective-c. clearly I have the wrong idea here.
how do i get pathForResource to use c strings as an argument?
here is my function:
static...
I have a buffer of RGB unsigned char that I would like converted into a bitmap file, does anyone know how?
My RGB float is of the following format
R [(0,0)], G[(0,0)], B[(0,0)],R [(0,1)], G[(0,1)], B[(0,1)], R [(0,2)], G[(0,2)], B[(0,2)] .....
The values for each data unit ranges from 0 to 255. anyone has any ideas how I can go about ...
I have a YUV:420 (aka NV12) frame data, how can I get OpenGL to recognize its format for glTexImage2D() rendering.
I realize that I might have to perform colorspace transformation, but is there a way that I can tell openGl to command the graphic hardware to perform the colorspace transformation?
...
I am porting a project to the iPhone (from Windows Mobile) and sharing much of the generic C and C++ code as possible, using Objective-C++. However, during testing I have stumbled upon a curious and troublesome problem that only manifests when running on the device. I have distilled the problem code in to a new project to prove reprodu...
I am mixing Objective-C parts into a C++ project (please don't argue about that, its cross-platform).
I now want to invoke some C++ functions or methods on the correct thread (i.e. the main thread) in a cocoa enviroment.
My current approach is passing function pointers to an objective-c instance (derived from NSObject) and do performSel...
I have an iPhone project that uses GHUnit to conduct unit testing. Recently, I've needed to implement complex numbers and overload some operators to ease the calculation of FFTs. The goal here was to create a clean way to perform an FFT without the overhead of all the possible functionality that libraries like FFTW uses, and in this se...
I would like to create a portable library for iPhone, that also could be used for other platforms.
My question is the fallowing:
Does anyone knows what is the best to be used on the iPhone: Objective-C or Objective-C++? Does it works with C++ the same way as Objective-C with C or not?
Reasons: Objective-C is a superset of C, but Objec...