I'm mixing Objective-C and C++ in a .mm / .h files
I am not exactly great at ObjectiveC, particularly when it comes to
object creation and destruction.
My understanding is there are few methods for Object creation on OC.
For instance (No pun intended)
MyOCObject * x = [[MyOCObject alloc] init] at a later time [x
release]
Then there are factory objects, which I don't think I need anymore as
all this has been depricated into a new memory contract with commands
like new and delete or free...
Looking at my class below in the C++ class I have an pointer to an
ObjectiveC object that is not initialized until My C++ class is
constructed,
at which point I want to properly construct the OC Object and when my C
++ class destructor is call I want to free its instance.
I'm reading:
http://docs.mandragor.org/files/Programming_languages/Objective-C/Objective-C_Infrequently_Asked_Questions_en/q3.htm
at the moment to see if I can clarify this.
class MyClass
{
private:
MyObjectiveCObject * _inquiry;
BOOL _busy;
};
MyClass::MyClass
{
_inquiry = [MyObjectiveCObject new]
_busy = FALSE;
}
MyClass::~MyClass
{
[_inquiry delete];
}