Search code examples
c++objective-cpropertiesobjective-c++

Are C++ initializers called in Objective-C synthesized properties?


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?


Solution

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