views:

83

answers:

1

Are C++ initializers called in Objective-C synthesized properties? Meaning if I write a custom initializer for creation from another object of the same type (C++) does the synthesized property setter call that initializer?

A: 

I assume by initializer you actually mean a C++ constructor. In a synthesized setter the copy constructor for the C++ object is called.

Sven
You can use a C++ class with a zero-argument constructor as an Objective-C instance variable. http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCPlusPlus.html
Chuck
Sorry, I missed that. Fixed my answer. Has been a while since I worked with Objective-C++.
Sven