Another Query :
If am declaring an C++ object inside interface of Objective C. and this C++ object is not a pointer.How is it managed and destroyed?
Another Query : If am declaring an C++ object inside interface of Objective C.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If it’s not a pointer, then the C++ object will form part of the Objective-C object itself. So if the C++ object is 12 bytes then when you alloc the Objective-C object, 12 bytes of that object are reserved for the C++ object. So, whenever the Objective-C object is deallocated, those bytes that the C++ object is held in are destroyed along with the Objective-C object.
It’s no different to have any instance variables in an Objective-C object.